I dun a DIP, possibly the best DIP ever

Stefan Koch uplink.coder at googlemail.com
Thu Apr 23 14:03:55 UTC 2020


On Thursday, 23 April 2020 at 13:56:47 UTC, Stefan Koch wrote:
> On Thursday, 23 April 2020 at 13:48:54 UTC, Steven 
> Schveighoffer wrote:
>>
>> These kinds of puzzles are fun ;)
>>
>
> yeah no.
>
> It's not fun if you have to make sure the rewrite is what 
> people expect.
>
> Foo!(AliasSeq(1,2)...)... will expand to 
> Compiler_Tuple(Foo!(1), Foo!(2))

to make the point clearer:
----
template AliasSeq(seq...)
{
     alias AliasSeq = seq;
}

template Foo(alias X)
{
     struct S {  typeof(X) v = X; }
     enum Foo = S();
}
----
pragma(msg, Foo!(AliasSeq!(1, 2))...);

outputs:
----
tuple(S(1), S(2))
----


More information about the Digitalmars-d mailing list