Conflict between function and template with the same name

Uranuz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 29 01:52:34 PDT 2014


> import std.stdio;
>
> string getByName(string name)
> {
> 	return "smth";
> }
>
> template getByName(string name)
> {
> 	enum getByName = .getByName(name);
> }
>
>
> void main()
> {
> 	writeln(getByName!("name"));
> }

Thanks a lot! Very interesting. Do you see any reasoning why this 
happens?


More information about the Digitalmars-d-learn mailing list