Create an Account
username: password:
  MemeStreams Logo

MemeStreams Discussion


This page contains all of the posts and discussion on MemeStreams referencing the following web page: oh baby, copy it deep!. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

oh baby, copy it deep!
by Acidus at 8:39 pm EDT, Apr 11, 2005

Copy Constructors you are the thorn in my side. I spent nearly half an hour tracking done something that should have been apparent right way:

If you have an object, which contains pointers to dynamic memory, adding to a vector (or any STL container) does a shallow copy! I needed a deep copy. I had some temp objects I was creating only to add them to an array, and then destory them. When they were destroyed, they would free the memory the object in the vector still referenced.

Segmentation Fault

... sigh... at least its all billable hours.

There is a redundant post from lclough not displayed in this view.
Powered By Industrial Memetics