Difference between revisions of "cpp/string/basic string/swap2"
From cppreference.com
< cpp | string | basic string
(Missed template parameter Traits) |
m (match C++14 wording tweak s/calls/equivalent/) |
||
Line 8: | Line 8: | ||
{{dcl end}} | {{dcl end}} | ||
− | Specializes the {{lc|std::swap}} algorithm for {{lc|std::basic_string}}. Swaps the contents of {{tt|lhs}} and {{tt|rhs}}. | + | Specializes the {{lc|std::swap}} algorithm for {{lc|std::basic_string}}. Swaps the contents of {{tt|lhs}} and {{tt|rhs}}. Equivalent to {{c|lhs.swap(rhs)}}. |
===Parameters=== | ===Parameters=== |
Revision as of 19:57, 19 March 2014
template< class T, class Traits, class Alloc > void swap( basic_string<T, Traits, Alloc> &lhs, basic_string<T, Traits, Alloc> &rhs ); |
||
Specializes the std::swap algorithm for std::basic_string. Swaps the contents of lhs
and rhs
. Equivalent to lhs.swap(rhs).
Contents |
Parameters
lhs, rhs | - | strings whose contents to swap |
Return value
(none)
Complexity
Constant.
See also
swaps the contents (public member function) |