When overloading assignment, I've been taught in my C++ course to return a reference to the lvalue being assigned to. This is easily possible in D, but in Phobos it is used rarely and in Ali Çehreli's Book it is neither taught to do so.

Is there any reason to it? To me it seems very obvious to do it like in C++.

The question came up in the discussion of a PR:
https://github.com/dlang/dlang.org/pull/1466

Reply via email to