Namespaces
Variants
Views
Actions

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/sidebar}}
+
{{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

 
 
 
std::basic_string
Member functions
Element access
Iterators
Capacity
Modifiers
Search
Operations
Constants
Non-member functions
swap(std::basic_string)
I/O
Comparison
(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
Numeric conversions
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Literals
Helper classes
Deduction guides (C++17)

 

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>

<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.

See also

Template:cpp/string/basic string/dcl list swap