On Sep 30, 8:27 am, "subramanian10...@yahoo.com, India"
<subramanian10...@yahoo.comwrote:
* James Kanze <james.ka...@gmail.comwrote:
Suppose I have kept the copy ctor of the element type T as 'explicit'.
Then, can I say that T is still CopyConstructible ?
Apparently, according to the text in the standard. I wouldn't
declare a copy constructor explicit, however---I'm not sure what
that means, or even what it should mean, logically.
Only if the implementation of the particular standard library
uses copy-initialization on some container(vector in this
case) operations, then those operations cannot be performed.
Am I correct ?
I'm not sure what you're trying to say, but if I understand
explicit copy constructors correctly, copy initialization isn't
allowed if the copy constructor is explicit. In practice,
however, I don't think it's an issue, since the objects are
passed by reference, and normally "copied" by using an explicit
invocation of placement new (since allocation and initialization
are separated), which is direct initialization.
(BTW: I wouldn't worry about these sort of things unless I were
actually writing a compiler. They just don't affect real code,
and there are a lot of more important issues to be concerned
with.)
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34