std::unordered_multimap<Key,T,Hash,KeyEqual,Allocator>::unordered_multimap
unordered_multimap() : unordered_multimap( size_type(/*implementation-defined*/) ) {} explicit unordered_multimap( size_type bucket_count, | (1) | (C++11以上) |
unordered_multimap( size_type bucket_count, const Allocator& alloc ) | (1) | (C++14以上) |
explicit unordered_multimap( const Allocator& alloc ); | (1) | (C++11以上) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, | (2) | (C++11以上) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, | (2) | (C++14以上) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, | (2) | (C++14以上) |
unordered_multimap( const unordered_multimap& other ); | (3) | (C++11以上) |
unordered_multimap( const unordered_multimap& other, const Allocator& alloc ); | (3) | (C++11以上) |
unordered_multimap( unordered_multimap&& other ); | (4) | (C++11以上) |
unordered_multimap( unordered_multimap&& other, const Allocator& alloc ); | (4) | (C++11以上) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count = /*implementation-defined*/, | (5) | (C++11以上) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count, | (5) | (C++14以上) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count, | (5) | (C++14以上) |
様々なデータソースから新しいコンテナを構築します。 オプションで作成する最小バケット数 bucket_count
、ハッシュ関数 hash
、キーを比較するための関数 equal
、アロケータ alloc
を指定できます。
max_load_factor()
は 1.0 に設定されます。 デフォルトコンストラクタの場合、バケット数は処理系定義です。[first, last)
の内容を持つコンテナを構築します。 max_load_factor()
は 1.0 に設定されます。other
の内容のコピーを持つコンテナを構築します。 負荷係数、述語、ハッシュ関数も同様にコピーされます。 alloc
が指定されない場合、アロケータは std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()) を呼ぶことによって取得されます。other
の内容を持つコンテナを構築します。 alloc
が指定されない場合、アロケータは other
の持つアロケータからムーブ構築によって取得されます。init
の内容を持つコンテナを構築します。 unordered_multimap(init.begin(), init.end()) と同様です。目次 |
[編集] 引数
alloc | - | このコンテナのすべてのメモリ確保に使用するアロケータ |
bucket_count | - | 初期化時に使用する最小バケット数。 指定されない場合は処理系定義のデフォルト値が使われます |
hash | - | 使用するハッシュ関数 |
equal | - | このコンテナのすべてのキー比較のために使用する比較関数 |
first, last | - | 要素をコピーする範囲 |
other | - | コンテナの要素を初期化するためのソースとして使用される別のコンテナ |
init | - | コンテナの要素を初期化するための初期化子リスト |
型の要件 | ||
-InputIt は LegacyInputIterator の要件を満たさなければなりません。 |
[編集] 計算量
first
と last
の距離に比例。 ワーストケースではその二乗。other
のサイズに比例。alloc
が指定されていて alloc != other.get_allocator() の場合は比例。init
のサイズに比例。 ワーストケースではその二乗。[編集] 例外
Allocator::allocate
の呼び出しは例外を投げるかもしれません。
[編集] ノート
other
を指す参照、ポインタ、イテレータ (終端イテレータは除く) は有効なまま残りますが、以後 *this 内の要素を指すようになります。 現行の標準ではこの保証は [container.requirements.general]/12 の包括的な文言によってなされていますが、より直接的な保証が LWG 2321 で検討されています。[編集] 例
This section is incomplete Reason: no example |
[編集] 欠陥報告
以下の動作変更欠陥報告は以前に発行された C++ 標準に遡って適用されました。
DR | 適用先 | 発行時の動作 | 正しい動作 |
---|---|---|---|
LWG 2193 | C++11 | the default constructor is explicit | made non-explicit |
[編集] 関連項目
コンテナに値を代入します (パブリックメンバ関数) |