Namespaces
Variants
Views
Actions

std::basic_string<CharT,Traits,Allocator>::swap

From cppreference.com
< cpp‎ | string‎ | basic string
Revision as of 14:06, 15 June 2012 by P12bot (Talk | contribs)

 
 
 
std::basic_string
Member functions
Element access
Iterators
Capacity
Modifiers
basic_string::swap
Search
Operations
Constants
Non-member functions
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)

 
void swap( basic_string& other );

Exchanges the contents of the string with those of other. All iterators and references remain valid.

Contents

Parameters

other - string to exchange the contents with

Return value

(none)

Example

Complexity

constant