bezel/array_construction_policy/std_memory.hbezel::array_construction_policy::std_memory
array_construction_policy::std_memoryは、単一オブジェクトに対してはデフォルトコンストラクタ・コピーコンストラクタ・デストラクタを、複数オブジェクトに対しては標準ヘッダmemoryで定義されている関数テンプレートstd::uninitialized_fill_nとstd::uninitialized_copyを用いた配列構築ポリシーの実装である。
メンバ関数constructとdestructに対する挙動は次の通り。
void construct(void* p)
new(を呼び出す。
p) T
void construct(void* p, const_reference v)
new(を呼び出す。
p) T(v)
void destruct(pointer p)
を呼び出す。
p->~T()
pointer construct(void* p, size_type n, array_marker_t)
を呼び出す。
construct(p, n, T())
pointer construct(void* p, size_type n, const_reference v)
を呼び出す。
std::uninitialized_fill_n(static_cast<pointer>(p), n, v)
template <typename In> pointer construct(void* p, In first, In last)
を呼び出す。
std::uninitialized_copy(first, last, static_cast<pointer>(p))
void destruct(pointer first, pointer last)
for ( ;
と等価な処理を行う。
first != last; ++first) destroy(first);