Typeof woes

Dicebot public at dicebot.lv
Tue Aug 20 17:15:06 PDT 2013


typeof only accepts expressions, not types.

Workaround:

template myTypeOf(T...)
    if (T.length == 1)
{
     static if (is(T))
         alias myTypeOf = T;
     else
         alias myTypeOf = typeof(T);
}


More information about the Digitalmars-d-learn mailing list