mrdocs::Expected::Expected
Constructors
Synopses
Declared in <mrdocs/Support/Expected.hpp>
Construct an engaged Expected with a default‐initialized value.
constexpr
Expected() noexcept(std::is_nothrow_default_constructible_v<T>)
requires std::is_default_constructible_v<T>;
Default copy constructor.
Copy‐construct, handling non‐trivial alternatives.
constexpr
Expected(Expected const& x) noexcept(std::is_nothrow_copy_constructible_v<T> && std::is_nothrow_copy_constructible_v<E>)
requires std::is_copy_constructible_v<T> &&
std::is_copy_constructible_v<E> &&
(!std::is_trivially_copy_constructible_v<T> ||
!std::is_trivially_copy_constructible_v<E>);
Construct from another Expected with potentially different types.
template<
class U,
class G>
requires std::is_constructible_v<T, U const&> &&
std::is_constructible_v<E, G const&> &&
(!constructible_from_expected<U, G>)
constexpr
explicit(explicit_conv<const U &, const G &>)
Expected(Expected<U, G> const& x) noexcept(std::is_nothrow_constructible_v<T, const U &> && std::is_nothrow_constructible_v<E, const G &>);
Default move constructor. Default move constructor.
Move‐construct, handling non‐trivial alternatives.
constexpr
Expected(Expected&& x) noexcept(std::is_nothrow_move_constructible_v<T> && std::is_nothrow_move_constructible_v<E>)
requires std::is_move_constructible_v<T> &&
std::is_move_constructible_v<E> &&
(!std::is_trivially_move_constructible_v<T> ||
!std::is_trivially_move_constructible_v<E>);
Move‐construct from another Expected with potentially different types.
template<
class U,
class G>
requires std::is_constructible_v<T, U> &&
std::is_constructible_v<E, G> &&
(!constructible_from_expected<U, G>)
constexpr
explicit(explicit_conv<U, G>)
Expected(Expected<U, G>&& x) noexcept(std::is_nothrow_constructible_v<T, U> && std::is_nothrow_constructible_v<E, G>);
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 an engaged Expected from a convertible value.
template<class U = T>
requires (!std::is_same_v<std::remove_cvref_t<U>, Expected>) &&
(!std::is_same_v<std::remove_cvref_t<U>, std::in_place_t>) &&
(!detail::isUnexpected<std::remove_cvref_t<U>>) &&
std::is_constructible_v<T, U>
constexpr
explicit(!std::is_convertible_v<U, T>)
Expected(U&& v) noexcept(std::is_nothrow_constructible_v<T, U>);
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>);
Construct an engaged Expected in‐place.
template<class... Args>
requires std::is_constructible_v<T, Args...>
constexpr
explicit
Expected(
std::in_place_t,
Args&&... args) noexcept(std::is_nothrow_constructible_v<T, Args...>);
Construct a disengaged Expected holding an error.
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 an engaged Expected from an initializer list.
template<
class U,
class... Args>
requires std::is_constructible_v<T, std::initializer_list<U>&, Args...>
constexpr
explicit
Expected(
std::in_place_t,
std::initializer_list<U> il,
Args&&... args) noexcept(std::is_nothrow_constructible_v<T, std::initializer_list<U> &, Args...>);
Construct a disengaged Expected from an initializer list.
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 value constructor. |
il |
Initializer list forwarded to the value constructor. |
Created with MrDocs