|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
constexprexplicit indirect(); | (1) | (since C++26) |
constexprexplicit indirect(std::allocator_arg_t,const Allocator& a); | (2) | (since C++26) |
template<class U= T> constexprexplicit indirect( U&& v); | (3) | (since C++26) |
template<class U= T> constexprexplicit indirect(std::allocator_arg_t,const Allocator& a, | (4) | (since C++26) |
template<class...Args> constexprexplicit indirect(std::in_place_t, Args&&...args); | (5) | (since C++26) |
template<class...Args> constexprexplicit indirect(std::allocator_arg_t,const Allocator& a, | (6) | (since C++26) |
template<class I,class...Args> constexprexplicit indirect(std::in_place_t,std::initializer_list<I> ilist, | (7) | (since C++26) |
template<class I,class...Args> constexprexplicit indirect(std::allocator_arg_t,const Allocator& a, | (8) | (since C++26) |
constexpr indirect(const indirect& other); | (9) | (since C++26) |
constexpr indirect(std::allocator_arg_t,const Allocator& a, const indirect& other); | (10) | (since C++26) |
constexpr indirect( indirect&& other)noexcept; | (11) | (since C++26) |
constexpr indirect(std::allocator_arg_t,const Allocator& a, indirect&& other)noexcept(/* see below */); | (12) | (since C++26) |
Constructs a newindirect object.
Contents |
| a | - | the allocator to be associated |
| v | - | value with which to initialize the owned value |
| args | - | arguments with which to initialize the owned value |
| il | - | initializer list with which to initialize the owned value |
| other | - | anotherindirect object whose owned value (if exists) is copied |
The construction of a newindirect object consists of the following steps:
alloc :alloc is empty, it isvalue-initialized.alloc is not empty, it isdirect-non-list-initialized with the initializer argument.p with the result of callingstd::allocator_traits<Allocator>::allocate, then callsstd::allocator_traits<Allocator>::construct(alloc , p , args...), whereargs... is an expression pack containing the initializer arguments.| Overload | Initializer for... | valueless_after_move()after construction | |
|---|---|---|---|
alloc | the owned object | ||
| (1) | (empty) | (empty) | false |
| (2) | a | ||
| (3) | (empty) | std::forward<U>(v) | |
| (4) | a | ||
| (5) | (empty) | std::forward<Args>(args) | |
| (6) | a | ||
| (7) | (empty) | ilist,std::forward<Args>(args) | |
| (8) | a | ||
| (9) | see below | *other (only ifother owns a value) | true only ifother is valueless |
| (10) | a | ||
| (11) | std::move(other.alloc ) | takes ownership (only ifother owns a value) | |
| (12) | a | see below | |
alloc is direct-non-list-initialized withstd::allocator_traits<Allocator>:: select_on_container_copy_construction(other.alloc ).UArgs...T is anincomplete type, the program is ill-formed.Throws nothing unlessstd::allocator_traits<Allocator>::allocate orstd::allocator_traits<Allocator>::construct throws.
| This section is incomplete Reason: no example |
(C++11) | tag type used to select allocator-aware constructor overloads (class)[edit] |
| in-place construction tag (tag)[edit] |