std::unordered_multimap<Key,T,Hash,KeyEqual,Allocator>::merge
提供: cppreference.com
template<class H2, class P2> void merge(std::unordered_map<Key, T, H2, P2, Allocator>& source); |
(1) | (C++17以上) |
template<class H2, class P2> void merge(std::unordered_map<Key, T, H2, P2, Allocator>&& source); |
(2) | (C++17以上) |
template<class H2, class P2> void merge(std::unordered_multimap<Key, T, H2, P2, Allocator>& source); |
(3) | (C++17以上) |
template<class H2, class P2> void merge(std::unordered_multimap<Key, T, H2, P2, Allocator>&& source); |
(4) | (C++17以上) |
source からの要素の抽出 (スプライシング) と、 *this のハッシュ関数および同値述語を使用したその要素の *this への挿入を試みます。
要素はコピーもムーブもされません。 コンテナのノードの内部ポインタが指し変えられるだけです。 転送される要素を指すすべてのポインタと参照は有効なままですが、 source ではなく *this 内を指すようになります。 転送される要素を指すイテレータおよび *this を参照するすべてのイテレータが無効化されます。
get_allocator() != source.get_allocator() の場合、動作は未定義です。
引数
| source | - | ノード転送元の互換なコンテナ |
戻り値
(なし)
計算量
平均的なケースでは O(N)、ワーストケースでは O(N*size()+N)、ただし N は source.size() です。
例
| This section is incomplete Reason: no example |
関連項目
(C++17) |
コンテナからノードを抽出します (パブリックメンバ関数) |
| 要素またはノード (C++17以上)を挿入します (パブリックメンバ関数) |