[CLN-list] modular polynomials
Alexei Sheplyakov
varg at theor.jinr.ru
Sun Sep 28 10:42:13 CEST 2008
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/cln-list/attachments/20080928/4ad79b49/attachment.sig
More information about the CLN-list
mailing list