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

std::array::swap

void swap( array& other );

(since C++11)

将容器的内容与other不会导致迭代器和引用与另一个容器关联。

参数

other

-

container to exchange the contents with

返回值

%280%29

例外

noexcept specification: noexcept(noexcept(std::swap(declval<T&>(), declval<T&>())))

(until C++17)

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

(since C++17)

对于零大小的数组,

noexcept规格:

noexcept

复杂性

容器的大小是线性的。

另见

std::swap(std::array) (C++11)

specializes the std::swap algorithm (function template)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券