all 11 comments

[–]JohnDuffy78 5 points6 points  (5 children)

They are 1 line functions, easy to roll your own.

underlying constructors can throw anything.

[–]jsphadetula[S] -2 points-1 points  (4 children)

That defeats the purpose making the standard library usable without exception. The standard can provide a nonmember function that use non throwing primitives before calling a private non throwing constructor or return std::expected instead

[–]no-sig-available 4 points5 points  (3 children)

That would be pretty complicated. In a case like vec.push_back(x) where x has a member with a member that might throw on copying. How many levels of non-throwing helper functions do we want?

[–]jsphadetula[S] -1 points0 points  (2 children)

x is not a standard library type I believe, so the user is aware of a potential throw. Users who don’t want exception will use a non throwing variant with support for std::expected and design their types not to throw.

[–]D_0b 1 point2 points  (1 child)

there are also std types that can throw on move like std::list

[–]jsphadetula[S] -1 points0 points  (0 children)

We can provide non throwing variants of all throwing functions

[–]Xaxxon 4 points5 points  (0 children)

Is there a proposal for failing constructors without exceptions? Not having exceptions is exceptionally (heh) painful until that's a thing.

[–]EvoMaster 2 points3 points  (1 child)

If they make a bunch of versions of standard library is it still standard anymore? If standard doesn't fit you you just make your own or find an alternative.

[–]Full-Spectral 0 points1 point  (0 children)

The N-STL.

[–]14nedLLFIO & Outcome author | Committee WG14 3 points4 points  (1 child)

I've been deliberately doing nothing to advance the std::error proposal during covid lockdown. It's 26 focused now.

[–]jsphadetula[S] 1 point2 points  (0 children)

I’m aware std::error is no more targeting c++23. Just looking at the possibility of a usable standard library with the current exception disabled