On 3/23/14, Philippe Sigaud <philippe.sig...@gmail.com> wrote:
> But this is not accepted by the grammar right now, because of __traits()

Pretty sure it's because you're using 'alias' instead of 'enum'. This works:

-----
enum isSomething(T) = __traits(compiles,
        {
           int up;
           T.init.doSomething(up);
        }
    );

void main()
{
    static struct S { void doSomething(int); }
    static struct X { void doSomething(string); }
    static assert(isSomething!S);
    static assert(!isSomething!X);
}
-----

Reply via email to