Template alias parameter does not accept functions

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Feb 27 10:16:46 PST 2013


On 2/27/13, Dicebot <m.strashun at gmail.com> wrote:
> Ye, lambda litteral issue is different one.
> My code example: http://dpaste.1azy.net/b06370ea

The problem is not in the alias, it's in the call to .stringof, the
compiler attempts to invoke the function passed and then call
.stringof on it.

If all you want is the name of the function you can use a trait:

template check(alias Symbol)
{
    enum check = __traits(identifier, Symbol);
}


More information about the Digitalmars-d-learn mailing list