C++ vectors exception handling
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.
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
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
Popular Topics
Advertisement