std::uses_allocator_construction_args
From cppreference.com
| Defined in header <memory>
|
||
T is not a specialization of std::pair |
||
| template< class T, class Alloc, class... Args > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(1) | (since C++20) |
T is a specialization of std::pair |
||
| template< class T, class Alloc, class Tuple1, class Tuple2 > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(2) | (since C++20) |
| template< class T, class Alloc > constexpr auto uses_allocator_construction_args( const Alloc& alloc ) noexcept; |
(3) | (since C++20) |
| template< class T, class Alloc, class U, class V > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(4) | (since C++20) |
| template< class T, class Alloc, class U, class V > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(5) | (since C++23) |
| template< class T, class Alloc, class U, class V > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(6) | (since C++20) |
| template< class T, class Alloc, class U, class V > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(7) | (since C++20) |
| template< class T, class Alloc, class U, class V > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(8) | (since C++23) |
| template< class T, class Alloc, class NonPair > constexpr auto uses_allocator_construction_args( const Alloc& alloc, |
(9) | (since C++20) |
Prepares the argument list needed to create an object of the given type T by means of uses-allocator construction.
1) This overload participates in overload resolution only if
T is not a specialization of std::pair. Returns std::tuple determined as follows:
- If std::uses_allocator_v<T, Alloc> is false and std::is_constructible_v<T, Args...> is true, returns std::forward_as_tuple(std::forward<Args>(args)...).
- Otherwise, if std::uses_allocator_v<T, Alloc> is true and std::is_constructible_v<T, std::allocator_arg_t, const Alloc&, Args...> is true, returns
std::tuple<std::allocator_arg_t, const Alloc&, Args&&...>(std::allocator_arg, alloc,
std::forward<Args>(args)...). - Otherwise, if std::uses_allocator_v<T, Alloc> is true and std::is_constructible_v<T, Args..., const Alloc&> is true, returns std::forward_as_tuple(std::forward<Args>(args)..., alloc).
- Otherwise, the program is ill-formed.
2) This overload participates in overload resolution only if
T is a specialization of std::pair. For T that is std::pair<T1, T2>, equivalent to
return std::make_tuple(std::piecewise_construct, std::apply([&alloc](auto&&... args1) { return std::uses_allocator_construction_args<T1>(alloc, std::forward<decltype(args1)>(args1)...); }, std::forward<Tuple1>(x) ), std::apply([&alloc](auto&&... args2) { return std::uses_allocator_construction_args<T2>(alloc, std::forward<decltype(args2)>(args2)...); }, std::forward<Tuple2>(y) ) );
3) This overload participates in overload resolution only if
T is a specialization of std::pair. Equivalent to
return std::uses_allocator_construction_args<T>(alloc, std::piecewise_construct, std::tuple<>{}, std::tuple<>{} );
4) This overload participates in overload resolution only if
T is a specialization of std::pair. Equivalent to
return std::uses_allocator_construction_args<T>(alloc, std::piecewise_construct,