nested function overloading

monkyyy crazymonkyyy at gmail.com
Wed Jun 22 06:05:17 UTC 2022


On Monday, 20 June 2022 at 13:20:51 UTC, Steven Schveighoffer 
wrote:
> And you can also use an inner struct to define overloaded 
> functions.

I believe templates make a better bandaid
```d
void main(){
	template bar(){
		void bar_(int){}
		void bar_(float){}
		alias bar=bar_;
	}
	bar(1);
	bar(3.14);
}
```


More information about the Digitalmars-d-learn mailing list