std::swap(std::basic_string)_C++中文网
| 定义于头文件 |
||
| template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, |
(C++17 前) | |
| template< class CharT, class Traits, class Alloc > void swap( std::basic_string<CharT, Traits, Alloc> &lhs, |
(C++17 起) (C++20 前) |
|
| template< class CharT, class Traits, class Alloc > constexpr void |
(C++20 起) | |
为 std::basic_string 特化 std::swap 算法。交换 lhs 与 rhs 的内容。等价于 lhs.swap(rhs) 。
参数
返回值
(无)
复杂度
常数。
异常 |
(C++17 起) |