4 ms·
So how does this actually work with instances that would throw one? Are the standard libraries not very dependent on them?
by setra 10y ago
So how does this actually work with instances that would throw one? Are the standard libraries not very dependent on them?
- jeffinhat 10y agoA lot of large C++ shops re-implement much of the standard library, often to add niche features that don't make sense as a standard. I believe replacing the allocator in a lot of the standard data structures to a non-throwing one will get you pretty close to non-throwing.
- pjc50 10y agoThe standard libraries tend to only use them for fatal conditions such as out of memory. The standard library can compile with no-exceptions (see https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_exceptions.html https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_except... ); if you mix no-exception and exception-using code, what happens is implementation-dependent but usually involves crashing.
- blub 10y agovector::at & co and std::stoi & co will throw. Big one: optional will throw.
- brandmeyer 10y agostd::function can throw, too