You cannot overload identity assignment for classes. It's a language construct that rebinds a reference and cannot be overridden. Such opAssign overloading is only possible for structs.

See http://dlang.org/operatoroverloading.html#Assignment.

I need to be able to implement "=" operator so that this works:

auto x_ = new X(), x2 = x_ ;

objects)alive needs to be 2 after.

Thanks ...

Reply via email to