4 ms·
> And then there are of course people who just disable exceptions. Some disable exceptions but still use the standard library and just kind of hope that everyth
by jschwartzi 7y ago
> And then there are of course people who just disable exceptions. Some disable exceptions but still use the standard library and just kind of hope that everything will still work?
No, there are features in most of the standard library that allow you to confirm that an object is in a state where it won't throw an exception, and you use those. For example, with std::map you can check the return of find() against end() to determine whether you can safely access the second element of the tuple. So you would do that before you access the tuple.
And you would generally write your own classes to either crash the process quickly or fail gracefully on construction. Basically you have to manage the shutdown of your process when you encounter exceptional situations in the constructor.
You can also count on any "exception" that is thrown with no-exceptions to result in an immediate crash.