News for hackers. Stuff that matters.
Re:When noexcept? by setra on Thursday December 15, 2016 @09:55AM (#13184944)
So how does this actually work with instances that would throw one? Are the standard libraries not very dependent on them?
Re:When noexcept? by pjc50 on Thursday December 15, 2016 @10:53AM (#13185375)
The 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_except... ); if you mix no-exception and exception-using code, what happens is implementation-dependent but usually involves crashing.
Re:When noexcept? by blub on Thursday December 15, 2016 @11:11AM (#13185570)
vector::at & co and std::stoi & co will throw. Big one: optional will throw.
Re:When noexcept? by brandmeyer on Thursday December 15, 2016 @12:37PM (#13186385)
std::function can throw, too
Re:When noexcept? by jeffinhat on Thursday December 15, 2016 @10:49AM (#13185352)
A 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.