[string.swap] (original) (raw)
27 Strings library [strings]
27.4 String classes [string.classes]
27.4.3 Class template basic_string [basic.string]
27.4.3.7 Modifiers [string.modifiers]
27.4.3.7.8 basic_string::swap [string.swap]
constexpr void swap(basic_string& s) noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value || allocator_traits<Allocator>::is_always_equal::value);
Preconditions: allocator_traits<Allocator>::propagate_on_container_swap::value is trueorget_allocator() == s.get_allocator().
Postconditions: *thiscontains the same sequence of characters that was in s,s contains the same sequence of characters that was in*this.
Complexity: Constant time.