On Thursday, 23 May 2013 at 11:57:04 UTC, Namespace wrote:
I know that D has (sadly) no C++ references, but I still think that

A a = some_existing_A;

should call opAssign.

Now I see what has you confused. Whether postblit or opAssign is called, depend on left, not right side of assignment. Object 'a' didn't exists prior, so postblit is called, and copy ctor is called with respect of 'a' as 'this' argument.

Reply via email to