constructor · 13 overloads
std::expected<T, E>::expected
- Header
<expected>- Draft
- [expected.syn]
- Scope
std::expected<T, E>- cppreference
- <expected> nearest page
Constructors
Overloads
- (1)
constexpr expected() noexcept; - (2)
constexpr expected( const expected& other) noexcept(nothrow_copy) = default requires is_copy_constructible_v<E> && is_trivially_copy_constructible_v<E>; - (3)
constexpr expected(const expected& other) = delete requires (!is_copy_constructible_v<E>); - (4)
constexpr expected( const expected& rhs) noexcept(nothrow_copy) requires is_copy_constructible_v<E> && (!is_trivially_copy_constructible_v<E>); - (5)
constexpr expected( expected&& other) noexcept(nothrow_move) = default requires is_move_constructible_v<E> && is_trivially_move_constructible_v<E>; - (6)
constexpr expected( expected&& rhs) noexcept(nothrow_move) requires is_move_constructible_v<E> && (!is_trivially_move_constructible_v<E>); - (7)
explicit constexpr expected(in_place_t value) noexcept; - (8)
template<class G> requires is_constructible_v<E, const G&> explicit(!is_convertible_v<const G &, E>) constexpr expected(const unexpected<G>& e); - (9)
template<class G> requires is_constructible_v<E, G> explicit(!is_convertible_v<G, E>) constexpr expected(unexpected<G>&& e); - (10)
template<class U, class G> requires is_void_v<U> && expected-void-converts-from<T, E, U, G, const G&> explicit(!is_convertible_v<const G &, E>) constexpr expected(const expected<U, G>& rhs); - (11)
template<class U, class G> requires is_void_v<U> && expected-void-converts-from<T, E, U, G, G> explicit(!is_convertible_v<G, E>) constexpr expected(expected<U, G>&& rhs); - (12)
template<class... Args> requires is_constructible_v<E, Args...> explicit constexpr expected(unexpect_t, Args&&... args); - (13)
template<class U, class... Args> requires is_constructible_v<E, initializer_list<U>&, Args...> explicit constexpr expected( unexpect_t, initializer_list<U> il, Args&&... args);