You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::expected very good candidate for alternative exceptions error-code principle. But there access value methods throw the exception bad_access_expected: again the exception! std::expected already have has_value method to check this situation.
Yes, std::optional::value() also throws exception, but std::expected specially class for exception-free code, in my opinion.
I personally thought about, why can't to remove explicit throwing any exception ?
For example, std::move_only_function's call "empty" state no more throws bad_functional_call exception, it simply cause an UB.
Pls, remove bad_access_expected class, and do not throw an any exception, explicitly! Let value() cause an UB, if there error state.