|
constexpr | expected () |
| デフォルトコンストラクタ
|
|
constexpr | expected (const expected &rhs) |
|
constexpr | expected (expected &&rhs) noexcept |
|
template<class U , class G >
requires (std::is_constructible_v<T, const U&> && std::is_constructible_v<E, const G&> && !converts_from_any_cvref<T, expected<U, G>&> && !std::is_constructible_v<unexpected<E>, expected<U, G>&> && !std::is_constructible_v<unexpected<E>, expected<U, G>> && !std::is_constructible_v<unexpected<E>, const expected<U, G>&> && !std::is_constructible_v<unexpected<E>, const expected<U, G>>) |
constexpr | expected (const expected< U, G > &rhs) |
|
template<class U , class G >
requires (std::is_constructible_v<T, U> && std::is_constructible_v<E, G> && !converts_from_any_cvref<T, expected<U, G>> && !std::is_constructible_v<unexpected<E>, expected<U, G>&> && !std::is_constructible_v<unexpected<E>, expected<U, G>> && !std::is_constructible_v<unexpected<E>, const expected<U, G>&> && !std::is_constructible_v<unexpected<E>, const expected<U, G>>) |
constexpr | expected (const expected< U, G > &&rhs) noexcept |
|
template<class U = T>
requires (std::is_constructible_v<T, U> && !std::is_same_v<expected, std::remove_cvref_t<U>> && !std::is_same_v<std::remove_cvref_t<U>, std::in_place_t>) |
constexpr | expected (U &&v) |
|
template<class G > |
constexpr | expected (const unexpected< G > &e) |
|
constexpr | ~expected ()=default |
| デストラクタ
|
|
constexpr const T * | operator-> () const noexcept |
| 正常値のポインタを返す.
|
|
constexpr T * | operator-> () noexcept |
| 正常値のポインタを返す.
|
|
constexpr const T & | operator* () const &noexcept |
| 正常値を参照する.
|
|
constexpr T & | operator* () &noexcept |
| 正常値を参照する.
|
|
constexpr | operator bool () const noexcept |
|
constexpr bool | has_value () const noexcept |
| 正常値を持っている場合に true を返す.
|
|
constexpr const T & | value () const |
| 正常値を返す.
|
|
constexpr T & | value () |
| 正常値を返す.
|
|
constexpr const E & | error () const |
| 失敗時の値を返す.
|
|
constexpr E & | error () |
| 失敗時の値を返す.
|
|
template<class U >
requires (std::is_constructible_v<T, U> && std::is_copy_constructible_v<T>) |
constexpr T | value_or (U &&v) const & |
|
template<class G = E>
requires (std::is_constructible_v<E, G> && std::is_copy_constructible_v<E>) |
constexpr E | error_or (G &&e) const & |
|
template<class Return > |
constexpr expected< Return, E > | and_then (const std::function< expected< Return, E >(T)> &func) const & |
|
template<class Func , class Ret = std::invoke_result_t<Func, T>>
requires (std::is_invocable_r_v<Ret, Func, T> && std::is_same_v<typename Ret::error_type, E> && std::is_same_v<std::remove_cvref_t<Ret>, expected<typename Ret::value_type, E>>) |
constexpr auto | and_then (Func &&func) const & |
|
template<impl::IsExpected T, typename E>
class designlab::nostd::expected< T, E >
自作の expected クラス
- テンプレート引数
-
T | 型 T は成功時の値の型 |
E | 型 E は失敗時の値の型 |
my_expected.h の 46 行目に定義があります。