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

std::stack::swap

void swap( stack& other ) noexcept(/* see below */);

?

(since C++11)

将容器适配器的内容与other.有效地打电话usingstd::swap; swap(c, other.c);

参数

other

-

container adaptor to exchange the contents with

返回值

%280%29

例外

In the noexcept expressions below, the identifier swap is looked up in the same manner as the C++17 std::is_nothrow_swappable trait. noexcept specification: noexcept(noexcept(swap(c, other.c)))

(until C++17)

noexcept specification: noexcept(std::is_nothrow_swappable<Container>::value)

(since C++17)

复杂性

与底层容器%28相同,通常为常数%29。

另见

std::swap(std::stack)

specializes the std::swap algorithm (function template)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com