mrdocs::Expected<T, E>::Expected

Constructors

Synopses

Declared in <mrdocs/Support/Expected.hpp>

Construct an engaged Expected<void>.

constexpr
Expected() noexcept;

Default copy constructor.

Expected(Expected const& other) = default;

Copy‐construct with explicit error handling for non‐trivial E.

constexpr
Expected(Expected const& x) noexcept(std::is_nothrow_copy_constructible_v<E>)
requires std::is_copy_constructible_v<E> &&
        (!std::is_trivially_copy_constructible_v<E>);

Default move constructor.

Expected(Expected&& other) = default;

Move‐construct with explicit error handling for non‐trivial E.

constexpr
Expected(Expected&& x) noexcept(std::is_nothrow_move_constructible_v<E>)
requires std::is_move_constructible_v<E> &&
        (!std::is_trivially_move_constructible_v<E>);

Construct an engaged Expected with in‐place tag.

constexpr
explicit
Expected(std::in_place_t value) noexcept;

Construct a disengaged Expected from an unexpected error (copy).

template<class G = E>
requires std::is_constructible_v<E, G const&>
constexpr
explicit(!std::is_convertible_v<const G &, E>)
Expected(Unexpected<G> const& u) noexcept(std::is_nothrow_constructible_v<E, const G &>);

Construct a disengaged Expected from an unexpected error (move).

template<class G = E>
requires std::is_constructible_v<E, G>
constexpr
explicit(!std::is_convertible_v<G, E>)
Expected(Unexpected<G>&& u) noexcept(std::is_nothrow_constructible_v<E, G>);

Copy‐construct from a compatible Expected carrying void.

template<
    class U,
    class G>
requires std::is_void_v<U> &&
        std::is_constructible_v<E, G const&> &&
        (!constructible_from_expected<U, G>)
constexpr
explicit(!std::is_convertible_v<const G &, E>)
Expected(Expected<U, G> const& x) noexcept(std::is_nothrow_constructible_v<E, const G &>);

Move‐construct from a compatible Expected carrying void.

template<
    class U,
    class G>
requires std::is_void_v<U> &&
        std::is_constructible_v<E, G> &&
        (!constructible_from_expected<U, G>)
constexpr
explicit(!std::is_convertible_v<G, E>)
Expected(Expected<U, G>&& x) noexcept(std::is_nothrow_constructible_v<E, G>);

Construct a disengaged Expected from error arguments.

template<class... Args>
requires std::is_constructible_v<E, Args...>
constexpr
explicit
Expected(
    unexpect_t,
    Args...&&... args) noexcept(std::is_nothrow_constructible_v<E, Args...>);

Construct a disengaged Expected from an initializer list of errors.

template<
    class U,
    class... Args>
requires std::is_constructible_v<E, std::initializer_list<U>&, Args...>
constexpr
explicit
Expected(
    unexpect_t,
    std::initializer_list<U> il,
    Args...&&... args) noexcept(std::is_nothrow_constructible_v<E, std::initializer_list<U> &, Args...>);

Parameters

Name Description

args

Arguments forwarded to the error constructor.

il

Initializer list forwarded to the error constructor.

Created with MrDocs