bool has_unexpected(expected<T, boost::exception_ptr> const& e) { try { if(!e) boost::rethrow_exception(e.error()); } catch(Ex& e) { return true; } catch(...) { } return false; }
void operator()(expected<T>& x) { if (x) (*this)(*x); else (*this)(x.error()); }
BOOST_CONSTEXPR bool has_error(expected<T, E> const& e, E1 const& err) { return (e) ? false : (e.error() == err) ; }