Jump to content
  • Advertisement
Sign in to follow this  
Cacks

C++ vectors exception handling

This topic is 4559 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

Hi guys, how would I handle my C++ vector exceptions? What exception is thrown when there isn't enough memory to add another element? Thanks for any help given.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Cacks
Hi guys,

how would I handle my C++ vector exceptions? What exception is thrown when there isn't enough memory to add another element?

Thanks for any help given.


what would you do when you catch such an exception? out of memory is a serious problem and there usually isnt much you can do about it

Share this post


Link to post
Share on other sites
std::vector with throw std::bad_alloc if there is an out of memory or memory corruption exception. Well, technically thats usually a function of the underlying allocator, but the default allocator should throw std::bad_alloc

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!