Hi, On Sat, Sep 27, 2008 at 09:24:06PM +0200, Bruno Haible wrote:
The copy-constructor and the assignment operator should always do the same thing in C++.
AFAIR the standard does not require this.
People won't understand if
cl_UP a = ...; cl_UP b = a;
and
cl_UP a = ...; cl_UP b; b = a;
behave differently.
Yes, this is a bit unexpected, especially if it is not documented properly. Current behaviour is even more confusing, though.
And in CLN these simple assignments are only copying a simple reference, not the deep contents (see the other mail).
In C++ "deep copying" is typically called operator=. Calling some other operation `operator=' is a bit surprising, although there might be valid reasons to do so. But sometimes it's just plain inappropriate (case in point: cl_UP). Best regards, Alexei -- All science is either physics or stamp collecting.