alias and mixin

Philippe Sigaud via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 31 09:03:58 PDT 2014


> I recommend slightly more generic form:
>
> template Alias(T...)
>     if (T.length == 1)
> {
>     alias Alias = T[0];
> }
>
> it is quite helpful in templated code to be able to alias _anything_

That's what I use also, but didn't want another thread on the (T...)
if (T.length ==1) trick :)


>
> But yeah, no fun for mixins :(

Mainly, I slap them in my code, then slowly migrate them outwards (in
'head' position) until that compiles...


More information about the Digitalmars-d-learn mailing list