std::swap(std::basic_string)
template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, std::basic_string<CharT, Traits, Alloc> &rhs ); | | (until C++17) |
|---|---|---|
template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, std::basic_string<CharT, Traits, Alloc> &rhs ) noexcept(/* see below */); | | (since C++17) |
专攻std::swap算法std::basic_string.交换lhs和rhs相当于lhs.swap(rhs)...
参数
lhs, rhs | - | strings whose contents to swap |
|---|
返回值
%280%29
复杂性
常量。
Exceptions noexcept specification: noexcept(noexcept(lhs.swap(rhs))) | (since C++17) |
|---|
另见
swap | swaps the contents (public member function) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

