首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::unordered_multimap::merge

template<class H2, class P2> void merge(std::unordered_map<Key, T, H2, P2, Allocator>& source);

(1)

(since C++17)

template<class H2, class P2> void merge(std::unordered_map<Key, T, H2, P2, Allocator>&& source);

(2)

(since C++17)

template<class H2, class P2> void merge(std::unordered_multimap<Key, T, H2, P2, Allocator>& source);

(3)

(since C++17)

template<class H2, class P2> void merge(std::unordered_multimap<Key, T, H2, P2, Allocator>&& source);

(4)

(since C++17)

尝试提取%28“剪接”%29中的每个元素source然后插入*this的散列函数和键相等谓词。*this...

没有复制或移动元素,只有容器节点的内部指针被重新定位。所有指针和对传输元素的引用都仍然有效,但现在引用为*this,而不是进入source.迭代器指传递的元素,所有迭代器都指向*this都是无效的。

如果get_allocator() != source.get_allocator()...

参数

source

-

compatible container to transfer the nodes from

返回值

%280%29

例外

不抛出,除非相等或散列函数抛出。

复杂性

平均病例O%28N%29,最坏病例O%28N%2A大小%28%29+N%29,其中N为source.size()...

另见

extract (C++17)

extracts nodes from the container (public member function)

insert

inserts elements or nodes (since C++17) (public member function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券