Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Prev Up HomeNext

decltype(auto) try_operation_return_as(X)

This default implementation preferentially returns whatever the input type’s .as_failure() member function returns. basic_result and basic_outcome provide such a member function, see auto as_failure() const & .

If .as_failure() is not available, it will also match any .error() member function, which it wraps into a failure type sugar using failure(T &&, ...) .

Requires: That the expression std::declval<T>().as_failure() and/or std::declval<T>().error() is a valid expression.

Namespace: BOOST_OUTCOME_V2_NAMESPACE

Header: <boost/outcome/try.hpp>

Last revised: June 20, 2019 at 11:14:48 +0100


Prev Up HomeNext