Navigation :
Prerequisites
Build and install
Review of Error Handling Frameworks
Motivation
Future ABI stability guarantees
Tutorial
Recipes
Experimental
API reference
-
Macros
-
Concepts
-
Converters
-
Traits
-
Policies
-
Types
-
Aliases
-
Functions
--
Hooks
--
Iostream
--
Policy
-- `auto failure(T &&, ...)`
-- `auto success(T &&, ...)`
-- `bool try_operation_has_value(X)`
-- `decltype(auto) try_operation_extract_value(X)`
-- `decltype(auto) try_operation_return_as(X)`
-- `std::error_code error_from_exception(std::exception_ptr &&ep = std::current_exception(), std::error_code not_matched = std::make_error_code(std::errc::resource_unavailable_try_again)) noexcept`
-- `void strong_swap(bool &all_good, T &a, T &b)`
-- `void try_throw_std_exception_from_error(std::error_code ec, const std::string &msg = std::string{})`
Frequently asked questions
Videos
Changelog
History
decltype(auto) try_operation_extract_value(X)
This default implementation returns whatever the .assume_value()
or .value()
member functions return, preferentially choosing the former where both are available.
Requires : That the expression std::declval<T>().assume_value()
and/or std::declval<T>().value()
is a valid expression.
Namespace : OUTCOME_V2_NAMESPACE
Header : <outcome/try.hpp>