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

std::swap(std::array)

template< class T, std::size_t N > void swap( array<T,N>& lhs, array<T,N>& rhs );

?

(since C++11) (until C++17)

template< class T, std::size_t N > void swap( array<T,N>& lhs, array<T,N>& rhs ) noexcept(/* see below */);

?

(since C++17)

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

This function does not participate in overload resolution unless N == 0 or std::is_swappable<T>::value is true

(since C++17)

参数

lhs, rhs

-

containers whose contents to swap

返回值

%280%29

复杂性

容器的大小是线性的。

例外

noexcept specification: noexcept(noexcept(lhs.swap(rhs)))

(since C++17)

另见

swap

swaps the contents (public member function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com