構築、破棄、コピー
空のコンテナー・コンストラクター
concurrent_hash_map(); explicit concurrent_hash_map( const hash_compare_type& compare, const allocator_type& alloc = allocator_type() ); explicit concurrent_hash_map( const allocator_type& alloc );空の
concurrent_hash_mapを構築。バケットの初期数は未指定です。可能であれば、コンパレータ―
compareによりハッシュコードを計算し、key_typeオブジェクトが等しいかどうかを比較して、アロケーターallocを使用してメモリーを割り当てます。
concurrent_hash_map( size_type n, const hash_compare_type& compare, const allocator_type& alloc = allocator_type() ); concurrent_hash_map( size_type n, const allocator_type& alloc = allocator_type() );事前割り当てされた
n個のバケットを使用して、空のconcurrent_hash_mapを作成します。可能であれば、コンパレータ―
compareによりハッシュコードを計算し、key_typeオブジェクトが等しいかどうかを比較して、アロケーターallocを使用してメモリーを割り当てます。
要素のシーケンスから構築
template <typename InputIterator> concurrent_hash_map( InputIterator first, InputIterator last, const hash_compare_type& compare, const allocator_type& alloc = allocator_type() ); template <typename InputIterator> concurrent_hash_map( InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type() );半開区間
[first, last)のすべての要素を含むconcurrent_hash_mapを作成します。。半開区間
[first, last)に同じキーを持つ複数の要素が含まれている場合、どの要素が挿入されるかは未指定です。可能であれば、コンパレータ―
compareによりハッシュコードを計算し、key_typeオブジェクトが等しいかどうかを比較して、アロケーターallocを使用してメモリーを割り当てます。要件:
InputIteratorタイプは、[input.iterators] ISO C++ 標準のInputIterator要件を満たしている必要があります。
concurrent_hash_map( std::initializer_list<value_type> init, const hash_compare_type& compare = hash_compare_type(), const allocator_type& alloc = allocator_type() );
concurrent_hash_map(init.begin(), init.end(), compare, alloc)と等価です。
concurrent_hash_map( std::initializer_list<value_type> init, const allocator_type& alloc );
concurrent_hash_map(init.begin(), init.end(), alloc)と等価です。
コンストラクターをコピー
concurrent_hash_map( const concurrent_hash_map& other ); concurrent_hash_map( const concurrent_hash_map& other, const allocator_type& alloc );
otherのコピーを作成します。アロケーター引数が指定されていない場合、
std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator())を呼び出して取得できます。
otherとの同時操作が行われると動作は未定義です。
ムーブ・コンストラクター
concurrent_hash_map( concurrent_hash_map&& other ); concurrent_hash_map( concurrent_hash_map&& other, const allocator_type& alloc );ムーブ・セマンティクスを使用して、
otherの内容でconcurrent_hash_mapを作成します。
otherは有効のままですが、未指定の状態となります。アロケーター引数が指定されていない場合、
std::move(other.get_allocator())を呼び出して取得できます。
otherとの同時操作が行われると動作は未定義です。
デストラクター
~concurrent_hash_map();
concurrent_hash_mapを破棄します。ストアされた要素のデストラクターを呼び出してストレージの割り当てを解除します。
*thisとの同時操作が行われると動作は未定義です。
代入操作
concurrent_hash_map& operator=( const concurrent_hash_map& other );
*thisのすべての要素をotherの要素をコピーして置き換えます。
std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::valueがtrueの場合、アロケーターのコピーを割り当てます。
*thisとotherの同時操作が行われると動作は未定義です。戻り値:
*thisへの参照を返します。
concurrent_hash_map& operator=( concurrent_hash_map&& other );
*thisのすべての要素を、ムーブ・セマンティクスによってotherの要素で置き換えます。
otherは有効のままですが、未指定の状態となります。
std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::valueがtrueの場合、アロケーターの要素を移動して割り当てます。
*thisとotherの同時操作が行われると動作は未定義です。戻り値:
*thisへの参照を返します。
concurrent_hash_map& operator=( std::initializer_list<value_type> init );
*thisのすべての要素をinitの要素して置き換えます。
initに同じキーを持つ複数の要素が含まれている場合、どの要素が挿入されるかは未指定です。
*thisとの同時操作が行われると動作は未定義です。戻り値:
*thisへの参照を返します。
get_allocator
allocator_type get_allocator() const;戻り値:
*thisに関連付けられているアロケーターのコピーを返します。
