Shared object must have synchronized interface?

Domain dont_email at empty.com
Sat May 11 19:54:25 PDT 2013


class A
{
     public synchronized void test1()
     {
     }

     public void test2()
     {
     }
}

int main(string[] argv)
{
     auto a1 = new shared(A)();
     a1.test1();
     a1.test2();

     auto a2 = new A();
     a2.test1();
     a2.test2();
}

Error: function main.A.test2 () is not callable using argument 
types () shared
Error: function main.A.test1 () shared is not callable using 
argument types ()

So, if I want a class support both shared and non-shared, I must 
override all method?



More information about the Digitalmars-d-learn mailing list