#include <expected.h>
Public Member Functions | |
constexpr | unexpected (const unexpected &)=default |
constexpr | unexpected (unexpected &&)=default |
template<class Err = E, class = enable_if_t<!is_same_v<remove_cvref_t<Err>, unexpected> && !is_same_v<remove_cvref_t<Err>, in_place_t>&& is_constructible_v<E, Err>>> | |
constexpr | unexpected (Err &&) |
template<class... Args, class = enable_if_t<is_constructible_v<E, Args...>>> | |
constexpr | unexpected (in_place_t, Args &&...) |
template<class U , class... Args, class = enable_if_t<is_constructible_v<E, initializer_list<U>&, Args...>>> | |
constexpr | unexpected (in_place_t, initializer_list< U >, Args &&...) |
constexpr unexpected & | operator= (const unexpected &)=default |
constexpr unexpected & | operator= (unexpected &&)=default |
constexpr const E & | error () const &noexcept |
constexpr E & | error () &noexcept |
constexpr const E && | error () const &&noexcept |
constexpr E && | error () &&noexcept |
constexpr void | swap (unexpected &other) noexcept(is_nothrow_swappable_v< E >) |
template<class... Args, class > | |
constexpr | unexpected (in_place_t, Args &&... args) |
template<class U , class... Args, class > | |
constexpr | unexpected (in_place_t, initializer_list< U > il, Args &&... args) |
Friends | |
template<class E2 > | |
constexpr bool | operator== (const unexpected &, const unexpected< E2 > &) |
template<class E2 > | |
constexpr void | swap (unexpected< E2 > &x, unexpected< E2 > &y) noexcept(noexcept(x.swap(y))) |
Wraps the unexpected value in a type that distinguishes the unexpected value from the expected value. This avoids ambiguity when constructing an expected where value type and error type are the same i.e expected<int, int>