ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::unexpected< E > Class Template Reference

Exception thrown by expected::value() when the object is in the error state. More...

#include <expected.hpp>

Public Member Functions

constexpr unexpected (E const &e)
constexpr unexpected (E &&e)
constexpr auto error () const &noexcept -> E const &
constexpr auto error () &noexcept -> E &
constexpr auto error () &&noexcept -> E &&

Detailed Description

template<typename E>
class threadschedule::unexpected< E >

Exception thrown by expected::value() when the object is in the error state.

The base specialization for void carries no error payload and simply reports "bad expected access". The derived template bad_expected_access<E> additionally stores a copy of the error value.

Template Parameters
EError type. The void specialization serves as the common base.

Wrapper that holds an error value for constructing an expected in the error state.

Use unexpected to explicitly construct or assign an error into an expected object:

threadschedule::expected<int> result = threadschedule::unexpected(make_error_code(std::errc::invalid_argument));
A result type that holds either a value of type T or an error of type E.
Definition expected.hpp:215
Exception thrown by expected::value() when the object is in the error state.
Definition expected.hpp:162
Template Parameters
EThe error type.

Definition at line 161 of file expected.hpp.

Constructor & Destructor Documentation

◆ unexpected() [1/2]

template<typename E>
threadschedule::unexpected< E >::unexpected ( E const & e)
inlineexplicitconstexpr

Definition at line 164 of file expected.hpp.

◆ unexpected() [2/2]

template<typename E>
threadschedule::unexpected< E >::unexpected ( E && e)
inlineexplicitconstexpr

Definition at line 167 of file expected.hpp.

Member Function Documentation

◆ error() [1/3]

template<typename E>
auto threadschedule::unexpected< E >::error ( ) && -> E&&
inlineconstexprnoexcept

Definition at line 178 of file expected.hpp.

◆ error() [2/3]

template<typename E>
auto threadschedule::unexpected< E >::error ( ) & -> E&
inlineconstexprnoexcept

Definition at line 174 of file expected.hpp.

◆ error() [3/3]

template<typename E>
auto threadschedule::unexpected< E >::error ( ) const & -> E const&
inlinenodiscardconstexprnoexcept

Definition at line 170 of file expected.hpp.


The documentation for this class was generated from the following file: