21 Strings library [strings]

21.4 Class template basic_string [basic.string]

21.4.6 basic_string modifiers [string.modifiers]

21.4.6.8 basic_string::swap [string::swap]

void swap(basic_string<charT,traits,Allocator>& s);

Postcondition: *this contains the same sequence of characters that was in s, s contains the same sequence of characters that was in *this.

Throws: Nothing.

Complexity: constant time.