On Mittwoch, 7. April 2004 04:03, Jon Berndt wrote:
> I'm not positive, but it seems (roughly) like a vector push_back()
> operation causes the d'tor to be called after the first element is stored.
> To me, this seems to say that the push_back() operation copies the existing
> stored element[s] to a new location (resizing the container) and destroys
> the old copy of the object stored in the vector. I'm looking into this in
> Stroustrup, but if anyone has any insights to share on this I'd be
> interested to hear them.
That is true.

I won't consider this a big disadvantage since you don't need to care for 
memory allocation. But indeed depending on the application it is a 
performance hog.
If you want to do allocations yourself, make a vector of pointers not a vector 
of objects.

  Greetings

     Mathias

-- 
Mathias Fr�hlich, email: [EMAIL PROTECTED]

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to