Re: One very confused question about the Item 13 in the book "Exceptional C++" by Herb
shikn wrote:
Excuse me, I have question on this. How the compiler
recognized the objects in this raw memory are constructed or
not?
The compiler doesn't care.
If the initialization are in random sequence, such like,
while( vused_ < other.vused_ )
{ construct( v_+vused_, other.v_[vused_] );
++vused_;
++vused_;
}
Does destructor not execute to the unconstructed object?
Which destructor, when? The compiler destructs the objects it
constructed. You destruct those you constructed. (You can
trick the compiler into calling destructors on uninitialized
memory, but I don't think that that was goal here.
Dose the compiler mark the object which has finished
constructing? How does the compiler implement the parts of
"15.2/2" ?
I'm not sure I understand. ?15.2/1 only concerns objects which
are declared to have a type T -- the compiler doesn't ever
consider the possibility that there might be a T buried
somewhere in a char[], created by placement new.
--
James Kanze kanze.james@neuf.fr
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
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]