Topic: possible defect: copy constructors
Author: a9804814@unet.univie.ac.at (Thomas Mang)
Date: Wed, 21 Jan 2004 17:57:32 +0000 (UTC) Raw View
Hello,
In the 1998 Standard, 12.8 / 10 reads as follows:
"A copy constructor for a class X is a constructor with a first
parameter of type X& or of type const X&."
However, 12.8 / 2 list two additionally possible signatures:
"A non-template constructor for class X is a copy constructor if its
first parameter is of type X&, const X&, volatile X& or const volatile
X&,...".
I suggest to change the wording of 12.8 / 10 to include the volatile X&
and const volatile & versions too.
regards,
Thomas
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: better_cs_now@yahoo.com ("Dave")
Date: Thu, 22 Jan 2004 02:21:36 +0000 (UTC) Raw View
"Thomas Mang" <a9804814@unet.univie.ac.at> wrote in message
news:400E75E3.D1C676FC@unet.univie.ac.at...
> Hello,
>
> In the 1998 Standard, 12.8 / 10 reads as follows:
>
> "A copy constructor for a class X is a constructor with a first
> parameter of type X& or of type const X&."
>
>
> However, 12.8 / 2 list two additionally possible signatures:
> "A non-template constructor for class X is a copy constructor if its
> first parameter is of type X&, const X&, volatile X& or const volatile
> X&,...".
>
> I suggest to change the wording of 12.8 / 10 to include the volatile X&
> and const volatile & versions too.
>
>
> regards,
>
> Thomas
Also, is it necessary to account for both of the possible placements of the
cv qualifiers? e.g.
const X& AND
X const &
This is probably overkill, but I guess some may view it as necessary to be
completely correct...
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: gennaro_prota@yahoo.com (Gennaro Prota)
Date: Thu, 22 Jan 2004 02:21:49 +0000 (UTC) Raw View
On Wed, 21 Jan 2004 17:57:32 +0000 (UTC), a9804814@unet.univie.ac.at
(Thomas Mang) wrote:
>In the 1998 Standard, 12.8 / 10 reads as follows:
>
>"A copy constructor for a class X is a constructor with a first
>parameter of type X& or of type const X&."
Actually this is 12.*1* / 10.
>However, 12.8 / 2 list two additionally possible signatures: [...]
Much more than two :-) In theory infinite signatures are possible.
Yes, this is already a core issue; see:
http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#331
Genny.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]