Lazy mixins

Philippe Sigaud philippe.sigaud at gmail.com
Tue Mar 25 13:23:35 PDT 2014


That's probably not the solution you want, but could you use direct
string mixins?


import std.stdio;


string B() { return `void foo(double d) { writeln("foo(double)"); }`; }

class C
{
    void foo(int x) { writeln("x"); }
    mixin(B());
}

void main() {
    auto c = new C();
    c.foo(1.3);
}


More information about the Digitalmars-d mailing list