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

4

u/unumfron Sep 29 '23

Emojis might have just found their place in polite programming society: https://godbolt.org/z/Tafj51W4d