Template mixins

Simen Haugen simen at norstat.no
Fri Sep 5 03:29:21 PDT 2008


This is probably a stupid question, but I cannot get a simple mixin to work:

template Test(R, N=char[])
{
     mixin(R.stringof~" "~N~"() { return "~R.stringof~".init; }");
}

class C
{
     mixin Test!(bool, "T");
}

gives:
mixin Test!(bool, "T") does not match any template declaration

So there's obviously some basic stuff I don't get here...


More information about the Digitalmars-d-learn mailing list