by cageface · 14y ago · 0 comments
See here for many solutions: http://stackoverflow.com/questions/553103/can-i-disable-exce...
Object* obj = new (nothrow) Object;
If the above allocation fails, obj will have the value NULL. It's tedious, but you could replace the default, throwing allocation with a non-throwing allocation in all places of the STL. However, various parts of the STL throw other kinds of exceptions. But, I think one could have a compromise, where you deal with exceptions from libraries you use, but you don't throw any yourself, instead using C-style error handling.Are custom data structures available as open source that don't use exceptions? Or perhaps can you please name an engine that already has this?
Which usually aren't really recoverable anyway. I mean, you can also blow the stack. Then what? Just ignore those essentially unrecoverable eventualities and terminate.