constructor · 12 overloads
std::polymorphic::polymorphic
- Header
<memory>- Draft
- [polymorphic.syn]
- Scope
std::polymorphic- cppreference
- <memory> nearest page
Constructors
Overloads
- (1)
explicit constexpr polymorphic() requires is_default_constructible_v<Allocator>; - (2)
constexpr polymorphic(const polymorphic& other); - (3)
constexpr polymorphic(polymorphic&& other) noexcept; - (4)
template<class U = T> requires (!is_same_v<remove_cvref_t<U>, polymorphic>) && owned-ok<remove_cvref_t<U>, U> && (!is-in-place-type<remove_cvref_t<U>>) && is_default_constructible_v<Allocator> explicit constexpr polymorphic(U&& u); - (5)
explicit constexpr polymorphic(allocator_arg_t, const Allocator& a); - (6)
template<class U, class... Ts> requires is_same_v<remove_cvref_t<U>, U> && owned-ok<U, Ts...> && is_default_constructible_v<Allocator> explicit constexpr polymorphic(in_place_type_t<U>, Ts&&... ts); - (7)
constexpr polymorphic( allocator_arg_t, const Allocator& a, const polymorphic& other); - (8)
constexpr polymorphic( allocator_arg_t, const Allocator& a, polymorphic&& other) noexcept(traits::is_always_equal::value); - (9)
template<class U = T> requires (!is_same_v<remove_cvref_t<U>, polymorphic>) && owned-ok<remove_cvref_t<U>, U> && (!is-in-place-type<remove_cvref_t<U>>) explicit constexpr polymorphic(allocator_arg_t, const Allocator& a, U&& u); - (10)
template<class U, class I, class... Us> requires is_same_v<remove_cvref_t<U>, U> && owned-ok<U, initializer_list<I>&, Us...> && is_default_constructible_v<Allocator> explicit constexpr polymorphic( in_place_type_t<U>, initializer_list<I> ilist, Us&&... us); - (11)
template<class U, class... Ts> requires is_same_v<remove_cvref_t<U>, U> && owned-ok<U, Ts...> explicit constexpr polymorphic( allocator_arg_t, const Allocator& a, in_place_type_t<U>, Ts&&... ts); - (12)
template<class U, class I, class... Us> requires is_same_v<remove_cvref_t<U>, U> && owned-ok<U, initializer_list<I>&, Us...> explicit constexpr polymorphic( allocator_arg_t, const Allocator& a, in_place_type_t<U>, initializer_list<I> ilist, Us&&... us);