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

std::swap(std::priority_queue)

STD::交换%28std::优先级[医]队列%29

template< class T, class Container, class Compare > void swap( priority_queue& lhs, priority_queue& rhs (until C++17)
template< class T, class Container, class Compare > void swap( priority_queue<T,Container,Compare>& lhs, priority_queue<T,Container,Compare>& rhs ) noexcept(/* see below */(since C++17)

专攻std::swap算法std::priority_queue.交换lhsrhs.电话lhs.swap(rhs)...

参数

lhs, rhs-containers whose contents to swap

返回值

%280%29

复杂性

与交换底层容器相同。

例外

noexcept specification: noexcept(noexcept(lhs.swap(rhs)))(since C++17)

另见

swapswaps the contents (public member function)

© cppreference.com

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

http://en.cppreference.com/w/cpp/容器/优先级[医]队列/交换2