在线文档教程
C++
容器 | Containers

std::multiset::merge

STD::Multiset::Merge

template void merge(std::set& source(1)(since C++17)
template<class C2> void merge(std::set<Key, C2, Allocator>&& source(2)(since C++17)
template<class C2> void merge(std::multiset<Key, C2, Allocator>& source(3)(since C++17)
template<class C2> void merge(std::multiset<Key, C2, Allocator>&& source(4)(since C++17)

尝试提取%28“剪接”%29中的每个元素source然后插入*this的比较对象*this...

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

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

参数

source-compatible container to transfer the nodes from

返回值

%280%29

例外

除非比较抛出,否则不会抛出。

复杂性

n%2Alog%28 size%28%29+N%29%29,其中N为source.size()...

另见

extract (C++17)extracts nodes from the container (public member function)
insertinserts elements or nodes (since C++17) (public member function)

© cppreference.com

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

http://en.cppreference.com/w/cpp/container/multiset/Merge