Termimate

Header file terminate.hpp

#include "detail/common.hpp"

namespace outcome_v2_xxx
{
    namespace policy
    {
        struct terminate;
    }
}

Struct outcome_v2_xxx::policy::terminate

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

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

    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 implementing any wide attempt to access the successful state as calling std::terminate

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::terminate::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, calls std::terminate().


Function outcome_v2_xxx::policy::terminate::wide_error_check

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

Performs a wide check of state, used in the error() functions

Effects: If result does not have an error, calls std::terminate().


Function outcome_v2_xxx::policy::terminate::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 outcome does not have an exception, calls std::terminate().