4#ifndef TETL_EXPECTED_UNEXPECTED_HPP
5#define TETL_EXPECTED_UNEXPECTED_HPP
7#include <etl/_type_traits/is_constructible.hpp>
8#include <etl/_type_traits/is_nothrow_constructible.hpp>
9#include <etl/_type_traits/is_nothrow_swappable.hpp>
10#include <etl/_type_traits/is_same.hpp>
11#include <etl/_type_traits/is_swappable.hpp>
12#include <etl/_type_traits/remove_cvref.hpp>
13#include <etl/_utility/forward.hpp>
14#include <etl/_utility/in_place.hpp>
15#include <etl/_utility/move.hpp>
16#include <etl/_utility/swap.hpp>
23 template <
typename Err = E>
27 and etl::is_constructible_v<E, Err>
30 : _unex(
etl::forward<Err>(e))
34 template <
typename... Args>
35 requires etl::is_constructible_v<E, Args...>
39 : _unex(
etl::forward<Args>(args)...)
61 return etl::move(_unex);
66 return etl::move(_unex);
69 constexpr auto swap(
unexpected& other)
noexcept(etl::is_nothrow_swappable_v<E>) ->
void
70 requires etl::is_swappable_v<E>
73 swap(error(), other.error());
76 template <
typename E2>
79 return lhs.error() == rhs.error();
83 requires etl::is_swappable_v<E>
Definition adjacent_find.hpp:9
unexpected(E) -> unexpected< E >
Disambiguation tags that can be passed to the constructors of optional, variant, and any to indicate ...
Definition in_place.hpp:21
Definition unexpected.hpp:22
constexpr unexpected(unexpected &&)=default
constexpr unexpected(unexpected const &)=default
constexpr unexpected(Err &&e) noexcept(etl::is_nothrow_constructible_v< E, Err >)
Definition unexpected.hpp:29
constexpr unexpected(etl::in_place_t, Args &&... args) noexcept(etl::is_nothrow_constructible_v< E, Args... >)
Definition unexpected.hpp:36
constexpr auto error() &noexcept -> E &
Definition unexpected.hpp:54
friend constexpr auto swap(unexpected &x, unexpected &y) noexcept(noexcept(x.swap(y))) -> void
Definition unexpected.hpp:82
constexpr auto operator=(unexpected const &) -> unexpected &=default
constexpr auto error() const &noexcept -> E const &
Definition unexpected.hpp:49
constexpr auto swap(unexpected &other) noexcept(etl::is_nothrow_swappable_v< E >) -> void
Definition unexpected.hpp:69
constexpr auto error() const &&noexcept -> E const &&
Definition unexpected.hpp:59
friend constexpr auto operator==(unexpected const &lhs, unexpected< E2 > const &rhs) -> bool
Definition unexpected.hpp:77
constexpr auto error() &&noexcept -> E &&
Definition unexpected.hpp:64
constexpr auto operator=(unexpected &&) -> unexpected &=default