Closed viboes closed 10 years ago
See #48. Once we have a MonadException
concept, we can implement MonadException
operations as no member functions of expected<exception_ptr,T>
, given that expected<exception_ptr,T>
allows to retrieve the stored exception_ptr
with the error()
function.
boost/expected/algorithms/has_unexpected.hpp
contains a function that can be generalized to all the monad_error that store anexception_ptr
, as it is the case ofexpected<exception_ptr,T>
andfuture<T>
.An alternative is to define this function for the error themselves, but then the user must first get the error and then do the
has_exception
.