Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Thygrrr

STL dealloc

This topic is 5277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What happens to the leftover elements for example in a std::vector when it is not empty() at the time it's destroyed? [edited by - Thygrrr on June 3, 2004 7:45:31 PM]

Share this post


Link to post
Share on other sites
Advertisement
That's not what he asked. In that case the elements are pointers and they ARE destroyed.

It is consequential that the objects they point to are NOT destroyed.

[edited by - noVum on June 3, 2004 7:52:41 PM]

Share this post


Link to post
Share on other sites
Thanks for the quick replies

The answer is what I assumed, but I wasn''t at all sure whether I had to pop_back() every element upon deletion of the vector or whether I could just iterate through its elements (which are pointers in my case), delete the objects they point to, and let the vector''s destructor take care of the actual pointers.

It''s all clear now!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
noVum, don''t be rude.
the other poster added helpful information.
you''ll notice it was totally germane to what the original poster asked.

it''s certainly not "inconsequential."

sheesh.
ryan.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!