mixin templates as ailas paramters

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 24 16:43:25 PST 2016


Is there any reason why

mixin template Foo(T)
{

}

Struct Bar(ailas a)
{
     mixin a!int
}

doesn't work?
It gives an error saying that mixin templates are not normal 
templates.
I hacked around this by making Bar take an enumeration and then 
"static switch"ing on it to select the correct mixin template, 
but that makes the set of mixins i can pass it closed.

It needs to be a mixin template because I need to access Bar's 
this from inside Foo.


More information about the Digitalmars-d-learn mailing list