AliasSeq + isExpression type specialization behavior
Marc Schütz via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Nov 10 02:28:43 PST 2015
On Monday, 9 November 2015 at 22:41:50 UTC, Brian Schott wrote:
> Given the following code:
> ```
> import std.meta;
>
> static assert(is(char : dchar));
> static assert(is(AliasSeq!(int, char) : AliasSeq!(int, char)));
> static assert(is(AliasSeq!(int, char) : AliasSeq!(int, dchar)));
> ```
>
> The third static assert fails. Should it, given that the first
> and second pass?
This fails, too:
static assert(is(AliasSeq!(char) : AliasSeq!(dchar)));
Which makes sense IMO, because it can be thought of as an unnamed
struct, cp. the following:
struct A { char c; }
struct B { dchar c; }
static assert(is(A : B)); // fails, as expected
More information about the Digitalmars-d-learn
mailing list