Observers

`exception_type &assume_exception() & noexcept`

Narrow contract lvalue reference observer of the stored exception. NoValuePolicy::narrow_exception_check() is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs unless NoValuePolicy::narrow_exception_check() does that. Note that if exception_type is void, only a const overload returning void is present. Requires: Always available. Complexity: Depends on NoValuePolicy::narrow_exception_check(). Guarantees: An exception is never thrown. »

`exception_type &exception() &`

Wide contract lvalue reference observer of the stored exception. NoValuePolicy::wide_exception_check() is first invoked, then the reference to the exception is returned. As a valid default constructed exception is always present, no undefined behaviour occurs if NoValuePolicy::wide_exception_check() returns. Note that if exception_type is void, only a const overload returning void is present. Requires: Always available. Complexity: Depends on NoValuePolicy::wide_exception_check(). Guarantees: None. »

`exception_type failure() const noexcept`

Synthesising observer of the stored exception or error. If an exception is available, returns a copy of that directly. If an error is available, and not an exception, an ADL discovered free function auto basic_outcome_failure_exception_from_error(const EC &) is invoked. Default overloads for this function are defined in Outcome for std::error_code and boost::system::error_code, these return std::make_exception_ptr(std::system_error(ec)) and boost::copy_exception(boost::system::system_error(ec)) respectively. Requires: Both the traits is_error_code_available<T> and is_exception_ptr_available<T> are true. Complexity: Depends on basic_outcome_failure_exception_from_error(const EC &). »

`explicit operator bool() const noexcept`

Returns true if a value is present. Constexpr where possible. Alias for bool has_value() const noexcept . Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »

`explicit operator bool() const noexcept`

Returns true if a value is present. Constexpr where possible. Alias for bool has_value() const noexcept . Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »

`failure_type<error_type, exception_type> as_failure() const &`

Return the output from free function auto failure(T &&, ...) containing a copy of any errored and/or excepted state. The error and/or exception state is accessed using const error_type &assume_error() const & noexcept and const exception_type &assume_exception() const & noexcept . Requires: Always available. Complexity: Whatever that of error_type’s and/or exception_type’s copy constructor is. Guarantees: None. »

`static auto &&_error(Impl &&) noexcept`

Returns a reference to the error in the implementation passed in. No checking is done to ensure there is an error. Constexpr where possible. Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »

`static auto &&_exception(Impl &&) noexcept`

Returns a reference to the exception in the implementation passed in. No checking is done to ensure there is an error. Constexpr where possible. Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »

`static auto &&_value(Impl &&) noexcept`

Returns a reference to the value in the implementation passed in. No checking is done to ensure there is a value. Constexpr where possible. Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »

`static bool _has_error(Impl &&) noexcept`

Returns true if an error is present in the implementation passed in. Constexpr where possible. Requires: Always available. Complexity: Constant time. Guarantees: Never throws an exception. »