Throw bad_result_access

Header file throw_bad_result_access.hpp

#include "detail/common.hpp"

namespace outcome_v2_xxx
{
    namespace policy
    {
        template <class EC>
        struct throw_bad_result_access;
    }
}

Struct outcome_v2_xxx::policy::throw_bad_result_access

template <class EC>
struct throw_bad_result_access
{
    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 throws bad_result_access_with<EC> or bad_result_access during wide checks.

Can be used in result only.

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::throw_bad_result_access::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.

Effects: If result does not have a value, it throws bad_result_access_with<EC>.


Function outcome_v2_xxx::policy::throw_bad_result_access::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

Effects: If result does not have an error, it throws bad_result_access.


Function outcome_v2_xxx::policy::throw_bad_result_access::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

Effects: If result does not have an exception, it throws bad_outcome_access.