www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Identity assignment operator overload LEGAL for const, etc.

This rightfully doesn't compile:

class A {
     A opAssign(A a);   // Error: function test.A.opAssign identity  
assignment operator overload is illegal
}

But when instead of A you assign const(A), shared(A) or  
any_type_constructor(A) it compiles. Is this intended?


Tomek
Jan 10 2010