Why simple code using Rebindable doesn't compile ?

chmike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 30 01:26:48 PDT 2016


Oops, the duplicate alias instruction and main are copy past 
error. It looks like the code was already too complex for me. ;) 
Here is the code I tested

----
import std.typecons;

Rebindable!(immutable TestImpl) Test;

class TestImpl
{
     void foo() {}
     Test test() { __gshared x = new immutable TestImpl; return 
rebindable(x); }
}

void main()
{
     Test t = Test.test;
}
----


More information about the Digitalmars-d-learn mailing list