Difference between revisions of "cpp/string/basic string/swap2"
From cppreference.com
< cpp | string | basic string
m (Text replace - "{{cpp|" to "{{c|") |
m (Text replace - "/sidebar" to "/navbar") |
||
Line 1: | Line 1: | ||
{{cpp/title | swap<small>(std::basic_string)</small>}} | {{cpp/title | swap<small>(std::basic_string)</small>}} | ||
− | {{cpp/string/basic_string/ | + | {{cpp/string/basic_string/navbar}} |
{{ddcl list begin}} | {{ddcl list begin}} | ||
{{ddcl list item | | {{ddcl list item | |
Revision as of 14:06, 15 June 2012
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 std::swap algorithm for std::basic_string. Swaps the contents of lhs
and rhs
. Calls lhs.swap(rhs).
Contents |
Parameters
lhs, rhs | - | strings whose contents to swap |
Return value
(none)
Complexity
Constant.