allocator_traits::construct 方法

使用指定的配置器建構物件的靜態方法。

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

參數

  • al
    配置器物件。

  • ptr
    物件要建構之位置的指標。

  • args
    傳遞給物件建構函式的引數清單。

備註

靜態成員函式呼叫 (Function Call), al.construct(ptr, args...),如果該運算式語式正確,否則會評估 ::new (static_cast<void *>(ptr)) Uty(std::forward<Types>(args)...)。

需求

標題: <memory>

命名空間: std

請參閱

參考

allocator::construct

allocator_traits 類別