次の方法で共有


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 クラス