std::swap(std::basic_string)
From cppreference.com
Template:cpp/string/basic string/sidebar Template:ddcl list begin <tr class="t-dcl ">
<td class="t-dcl-nopad">template< class T, class Alloc >
void swap( basic_string<T,Alloc> &lhs, basic_string<T,Alloc> &rhs );
</td>
void swap( basic_string<T,Alloc> &lhs, basic_string<T,Alloc> &rhs );
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Specializes the Template:cpp algorithm for Template:cpp. Swaps the contents of lhs
and rhs
. Calls Template:cpp.
Contents |
Parameters
lhs, rhs | - | strings whose contents to swap |
Return value
(none)
Complexity
Constant.