Re: Get the type of 'alias this ='

2018-04-04 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 15:57:19 UTC, Simen Kjærås wrote: On Wednesday, 4 April 2018 at 15:49:31 UTC, Vladimirs Nordholm wrote: if (is(T == A) || is(T == B) || is(T == Enum)) if (is(T : Enum)) -- Simen Ah! Thanks a lot!

Re: Get the type of 'alias this ='

2018-04-04 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 15:49:31 UTC, Vladimirs Nordholm wrote: private template Mix() { this(Enum ee) { e = ee; } Enum e; alias this = e; } Oops, typo in the alias. Should be `alias e this`

Re: Get the type of 'alias this ='

2018-04-04 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 15:49:31 UTC, Vladimirs Nordholm wrote: if (is(T == A) || is(T == B) || is(T == Enum)) if (is(T : Enum)) -- Simen

Get the type of 'alias this ='

2018-04-04 Thread Vladimirs Nordholm via Digitalmars-d-learn
Hello people from D-land. Short question: Can get the type of a struct that has `alias this = ` ? See this example, where a struct is aliased to an enum: enum Enum { one, two, three, fourtytwo } private template Mix() { this(Enum ee) { e = ee; } Enum e; a