All narrow (hard UB)

Header file all_narrow.hpp

#include "detail/common.hpp"

namespace outcome_v2_xxx
{
    namespace policy
    {
        struct all_narrow;
    }
}

Struct outcome_v2_xxx::policy::all_narrow

struct all_narrow
{
    template <class Impl>
    static constexpr void wide_value_check(Impl&& self);

    template <class Impl>
    static constexpr void wide_error_check(Impl&& self);

    template <class Impl>
    static constexpr void wide_exception_check(Impl&& self);

    template <class Impl>
    static constexpr void narrow_value_check(Impl&& self) noexcept;

    template <class Impl>
    static constexpr void narrow_error_check(Impl&& self) noexcept;

    template <class Impl>
    static constexpr void narrow_exception_check(Impl&& self) noexcept;
};

Policy which treats wide checks as narrow checks.

Can be used in both result and outcome.

Function outcome_v2_xxx::policy::throw_bad_result_access::narrow_value_check

template <class Impl>
static constexpr void narrow_value_check(Impl&& self) noexcept;

Performs a narrow check of state, used in the assume_value() functions.

Effects: None.


Function outcome_v2_xxx::policy::throw_bad_result_access::narrow_error_check

template <class Impl>
static constexpr void narrow_error_check(Impl&& self) noexcept;

Performs a narrow check of state, used in the assume_error() functions

Effects: None.


Function outcome_v2_xxx::policy::throw_bad_result_access::narrow_exception_check

template <class Impl>
static constexpr void narrow_exception_check(Impl&& self) noexcept;

Performs a narrow check of state, used in the assume_exception() functions

Effects: None.


Function outcome_v2_xxx::policy::all_narrow::wide_value_check

template <class Impl>
static constexpr void wide_value_check(Impl&& self);

Performs a wide check of state, used in the value() functions. Calls narrow_value_check() and does nothing else.

Effects: None.


Function outcome_v2_xxx::policy::all_narrow::wide_error_check

template <class Impl>
static constexpr void wide_error_check(Impl&& self);

Performs a wide check of state, used in the error() functions. Calls narrow_error_check() and does nothing else.

Effects: None.


Function outcome_v2_xxx::policy::all_narrow::wide_exception_check

template <class Impl>
static constexpr void wide_exception_check(Impl&& self);

Performs a wide check of state, used in the exception() functions. Calls narrow_exception_check() and does nothing else.

Effects: None.