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