base
Implements the base class of most policy classes defining the narrow observer policies.
Requires: Nothing.
Namespace: BOOST_OUTCOME_V2_NAMESPACE::policy
Header: <boost/outcome/policy/base.hpp>
Protected member functions
Special
-
static void _ub(Impl &&)
Special function which causes noticeable hard undefined behaviour.
Observers
-
static bool _has_value(Impl &&) noexcept
Returns true if a value is present in the implementation passed in. Constexpr, never throws.
-
static bool _has_error(Impl &&) noexcept
Returns true if an error is present in the implementation passed in. Constexpr, never throws.
-
static bool _has_exception(Impl &&) noexcept
Returns true if an exception is present in the implementation passed in. Constexpr, never throws.
-
static bool _has_error_is_errno(Impl &&) noexcept
Returns true if the error code in the implementation passed in has a domain or category matching that of POSIX
errno
. Constexpr, never throws. -
static auto &&_value(Impl &&) noexcept
Returns a reference to the value in the implementation passed in. Constexpr, never throws.
-
static auto &&_error(Impl &&) noexcept
Returns a reference to the error in the implementation passed in. Constexpr, never throws.
-
static auto &&_exception(Impl &&) noexcept
Returns a reference to the exception in the implementation passed in. Constexpr, never throws.
Modifiers
-
static void _set_has_value(Impl &&, bool) noexcept
Sets whether the implementation has a value. Constexpr, never throws.
-
static void _set_has_error(Impl &&, bool) noexcept
Sets whether the implementation has an error. Constexpr, never throws.
-
static void _set_has_exception(Impl &&, bool) noexcept
Sets whether the implementation has an exception. Constexpr, never throws.
-
static void _set_has_exception(Impl &&, bool) noexcept
Sets whether the implementation’s error code has a domain or category matching that of POSIX
errno
. Constexpr, never throws.
Public member functions
-
static void narrow_value_check(Impl &&) noexcept
Observer policy performing hard UB if no value is present. Constexpr, never throws.
-
static void narrow_error_check(Impl &&) noexcept
Observer policy performing hard UB if no error is present. Constexpr, never throws.
-
static void narrow_exception_check(Impl &&) noexcept
Observer policy performing hard UB if no exception is present. Constexpr, never throws.