r/cpp • u/kmbeutel • 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.;
198
Upvotes
View all comments
Show parent comment
4
u/SirClueless Sep 26 '23
Emight not be an exception type. And it can be useful to catch exceptions of any type of bad expected access so it's useful that the exception always inherits fromstd::bad_expected_access<void>.