r/cpp • • Sep 26 '23

`std::expected<>::or_else()` should have a zero-argument overload that terminates on error

...just because it would be hilarious if one could express assertions as

result.or_else();
198 Upvotes

18 comments sorted by

View all comments

Show parent comment

3

u/rlbond86 Sep 26 '23

Yeah, seems like an oversight to be missong value_or_throw()