Re: AliasSeq + isExpression type specialization behavior
On Tuesday, 10 November 2015 at 13:47:23 UTC, Brian Schott wrote: On Tuesday, 10 November 2015 at 10:28:45 UTC, Marc Schütz wrote: 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 You're talking about Tuple. I'm talking about AliasSeq. A Tuple is just a struct with an AliasSeq member. Or seen from a different POV, an AliasSeq can be interpreted as the "innards" of the struct. IMO it therefore makes sense to expect an AliasSeq to behave analogously to a struct. The only exception to that is that AliasSeq auto-expands, of course.
Re: AliasSeq + isExpression type specialization behavior
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? `:` in `is` is for testing whether the left type is implicitly convertible to the right type. `char` is implicitly convertible to `dchar` by promoting it. But `AliasSeq`s are collections; they're only implicitly convertible to themselves.
Re: AliasSeq + isExpression type specialization behavior
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
Re: AliasSeq + isExpression type specialization behavior
On Tuesday, 10 November 2015 at 10:28:45 UTC, Marc Schütz wrote: 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 You're talking about Tuple. I'm talking about AliasSeq.
AliasSeq + isExpression type specialization behavior
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?