isExpression with bool template parameter

cal callumenator at gmail.com
Mon Mar 25 23:15:51 PDT 2013


On Tuesday, 26 March 2013 at 06:03:55 UTC, cal wrote:
> I.e., why I can't match on some generic second parameter - what 
> if the second parameter was an int:
>
> struct S(A, int B) {}
> static assert(is(S!(int, 5627) _ == S!(U, ??), U, ??));
>
> how to match that in the isExpression?
>
> cheers,
> cal

However this does work (and solves my problem):

struct S(A, int B){}

static if (is(S!(int, 5) _  : S!(U), U...))  // line B, fail
    pragma(msg, U.stringof); // tuple(int, 5);

But it seems like is(S!(int, 5) _  : S!(U, V), U, V) should work 
to me.



More information about the Digitalmars-d-learn mailing list