Aliasing arguments in the template parameter list of an is-expression

anonymous anonymous at example.com
Tue Mar 18 10:44:30 PDT 2014


On Tuesday, 18 March 2014 at 17:07:01 UTC, Ali Çehreli wrote:
> On 03/18/2014 09:02 AM, Meta wrote:
[...]
>> struct Pair(alias left, alias right) {}
>>
>> template Left(P)
>> if (is(P == Pair!(left, right), left, right)
>>     && is(typeof(left) == int)
>>     && is(typeof(right) == int))
>
> Too many typeofs there. left and right are already types:
>
>     && is(left == int)
>     && is(right == int))

No, Pair's left and right are alias parameters.


More information about the Digitalmars-d-learn mailing list