std::uses_allocator_construction_args_C++中文网

定义于头文件 <memory>

T 不是 std::pair 的特化

template< class T, class Alloc, class... Args >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc, Args&&... args) noexcept;

(1) (C++20 起)

Tstd::pair 的特化

template< class T, class Alloc, class Tuple1, class Tuple2 >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc, std::piecewise_construct_t, Tuple1&& x, Tuple2&& y) noexcept;

(2) (C++20 起)

template< class T, class Alloc >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc ) noexcept;

(3) (C++20 起)

template< class T, class Alloc, class U, class V >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc, U&& u, V&& v) noexcept;

(4) (C++20 起)

template< class T, class Alloc, class U, class V >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc, const std::pair<U,V>& pr) noexcept;

(5) (C++20 起)

template< class T, class Alloc, class U, class V >

constexpr std::tuple</*see below*/> uses_allocator_construction_args(

    const Alloc& alloc, std::pair<U,V>&& pr) noexcept;

(6) (C++20 起)

准备以使用分配器构造的手段创建给定类型 T 对象所需的参数列表。

1) 此重载仅若 T 不是 std::pair 的特化才参与重载决议。返回按下列方式确定的 std::tuple

2) 此重载仅若 Tstd::pair 的特化才参与重载决议。对于 T = std::pair<T1, T2> ,等价于

3) 此重载仅若 Tstd::pair 的特化才参与重载决议。等价于

4) 此重载仅若 Tstd::pair 的特化才参与重载决议。等价于

5) 此重载仅若 Tstd::pair 的特化才参与重载决议。等价于

6) 此重载仅若 Tstd::pair 的特化才参与重载决议。等价于

参数

alloc - 使用的分配器。
args - 传递给 T 构造函数的参数。
x - 传递给 T 的 .first 的构造函数的参数 tuple
y - 传递给 T 的 .second 的构造函数的参数 tuple
u - 传递给 T 的 .first 的构造函数的单个参数。
v - 传递给 T 的 .second 的构造函数的单个参数。
pr - pair ,将其 .first 传递给 T.first 的构造函数,并将其 .second 传递给 T.second 的构造函数的

返回值

适合于传递给 T 构造函数的参数的 std::tuple

示例

注意

重载 (2-6) 提供传入 std::pair 的分配器传播,它们不支持前导分配器或尾随分配器约定(不同于如使用前导分配器约定的 std::tuple )。

参阅