C++ vectors exception handling

Started by
2 comments, last by SiCrane 18 years, 2 months ago
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.
Reject the basic asumption of civialisation especially the importance of material possessions
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
Would I just do nothing?
Reject the basic asumption of civialisation especially the importance of material possessions
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

This topic is closed to new replies.

Advertisement