On Sunday, 29 June 2014 at 07:16:10 UTC, Uranuz wrote:
Is there any reason why function and template conflict. They using different syntax to *call*. For template we have *!* but for function we don't have it. So why compiler is not able to see the difference?

I suspect this is by design. The following works, note the dot before the getByName function call:

import std.stdio;

string getByName(string name)
{
        return "smth";
}

template getByName(string name)
{
        enum getByName = .getByName(name);
}


void main()
{
        writeln(getByName!("name"));
}

Reply via email to