allocator_traits::construct 方法

使用指定的分配器构造对象的静态方法。

template<class Uty, class Types>
    static void construct(Alloc& al, Uty *ptr, Types&&... args);

参数

  • al
    分配器对象。

  • ptr
    对象将构造的位置的指针。

  • args
    传递给对象构造函数的参数列表。

备注

如果该表达式是限定,静态成员函数调用 al.construct(ptr, args...);否则它计算 ::new (static_cast<void *>(ptr)) Uty(std::forward<Types>(args)...)。

要求

标头: <memory>

命名空间: std

请参见

参考

allocator::construct

allocator_traits 类