Aliasing arguments in the template parameter list of an is-expression
Ali Çehreli
acehreli at yahoo.com
Tue Mar 18 10:47:25 PDT 2014
On 03/18/2014 10:44 AM, anonymous wrote:
> 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.
Not in the Pair that I coded before sending that. :p
struct Pair(L, R)
{}
Ali
More information about the Digitalmars-d-learn
mailing list