Functions
-
Hooks
Functions used to hook into the functionality of
basic_result
andbasic_outcome
.-
uint16_t spare_storage(const basic_result|basic_outcome *) noexcept
Returns the sixteen bits of spare storage in the specified result or outcome.
-
void hook_outcome_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of
basic_outcome
. -
void hook_outcome_construction(T *, U &&, V &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of
basic_outcome
. -
void hook_outcome_copy_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of
basic_outcome
. -
void hook_outcome_copy_construction(T *, U &&, V &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of
basic_outcome
. -
void hook_outcome_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the in-place constructors of
basic_outcome
. -
void hook_outcome_move_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of
basic_outcome
. -
void hook_outcome_move_construction(T *, U &&, V &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of
basic_outcome
. -
void hook_result_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the implicit constructors of
basic_result
. -
void hook_result_copy_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting copy constructors of
basic_result
. -
void hook_result_in_place_construction(T *, in_place_type_t<U>, Args &&...) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the in-place constructors of
basic_result
. -
void hook_result_move_construction(T *, U &&) noexcept
(Until v2.2.0) ADL discovered free function hook invoked by the converting move constructors of
basic_result
. -
void override_outcome_exception(basic_outcome<T, EC, EP, NoValuePolicy> *, U &&) noexcept
Overrides the exception to something other than what was constructed.
-
void set_spare_storage(basic_result|basic_outcome *, uint16_t) noexcept
Sets the sixteen bits of spare storage in the specified result or outcome.
-
-
Iostream
Functions used to print, serialise and deserialise
basic_result
andbasic_outcome
.-
std::istream &operator>>(std::istream &, basic_outcome<T, EC, EP, NoValuePolicy> &)
Deserialises a
basic_outcome
from astd::istream
. -
std::istream &operator>>(std::istream &, basic_result<T, E, NoValuePolicy> &)
Deserialises a
basic_result
from astd::istream
. -
std::ostream &operator<<(std::ostream &, const basic_outcome<T, EC, EP, NoValuePolicy> &)
Serialises a
basic_outcome
to astd::ostream
. -
std::ostream &operator<<(std::ostream &, const basic_result<T, E, NoValuePolicy> &)
Serialises a
basic_result
to astd::ostream
. -
std::string print(const basic_outcome<T, EC, EP, NoValuePolicy> &)
Returns a string containing a human readable rendition of the
basic_outcome
. -
std::string print(const basic_result<T, E, NoValuePolicy> &)
Returns a string containing a human readable rendition of the
basic_result
.
-
-
Policy
Functions used to customise how the policy classes operate.
-
auto basic_outcome_failure_exception_from_error(const EC &)
ADL discovered free function synthesising an exception type from an error type, used by the
.failure()
observers. -
decltype(auto) error_code(T &&)
Extracts a
boost::system::error_code
orstd::error_code
from the input via ADL discovery of a suitablemake_error_code(T)
function. -
decltype(auto) exception_ptr(T &&)
Extracts a
boost::exception_ptr
orstd::exception_ptr
from the input via ADL discovery of a suitablemake_exception_ptr(T)
function. -
void outcome_throw_as_system_error_with_payload(BoostErrorCodeEnum &&)
Specialisation of
outcome_throw_as_system_error_with_payload()
for input types whereboost::system::is_error_code_enum<BoostErrorCodeEnum>
orboost::system::is_error_condition_enum<BoostErrorCodeEnum>
is true. -
void outcome_throw_as_system_error_with_payload(ErrorCodeEnum &&)
Specialisation of
outcome_throw_as_system_error_with_payload()
for input types wherestd::is_error_code_enum<ErrorCodeEnum>
orstd::is_error_condition_enum<ErrorCodeEnum>
is true. -
void outcome_throw_as_system_error_with_payload(const boost::system::error_code &)
Specialisation of
outcome_throw_as_system_error_with_payload()
forboost::system::error_code
. -
void outcome_throw_as_system_error_with_payload(const std::error_code &)
Specialisation of
outcome_throw_as_system_error_with_payload()
forstd::error_code
.
-
-
auto failure(T &&, ...)
Returns appropriate type sugar for constructing an unsuccessful result or outcome.
-
auto success(T &&, ...)
Returns appropriate type sugar for constructing a successful result or outcome.
-
bool try_operation_has_value(X)
Default implementation of
try_operation_has_value(X)
ADL customisation point forOUTCOME_TRY
. -
decltype(auto) try_operation_extract_value(X)
Default implementation of
try_operation_extract_value(X)
ADL customisation point forOUTCOME_TRY
. -
decltype(auto) try_operation_return_as(X)
Default implementation of
try_operation_return_as(X)
ADL customisation point forOUTCOME_TRY
. -
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
Returns an error code matching a thrown standard library exception.
-
void strong_swap(bool &all_good, T &a, T &b)
Tries to perform a strong guarantee swap.
-
void try_throw_std_exception_from_error(std::error_code ec, const std::string &msg = std::string{})
Try to throw a standard library exception type matching an error code.