26 May
2020
26 May
'20
9:53 p.m.
On 2020-05-25 22:21, Emil Dotchevski via Boost wrote:
You mean, as in:
Good example.
leaf::result<float> f(); // Returns a float or an error
leaf::result<int> g() // Returns an int or an error { (void) f(); // Discard the float or the error returned by f return 42; }
Suppose there is also an h() function in the call stack that is being called by the error_handler() function instead of g(): leaf::result<int> h() { auto res = g(); // How to detect that f() raised an error without knowing // its error_id? return res; } Can this function detect that someone further up the call stack has already raised an error? Similar to std::uncaught_exceptions()?