Files
2025-10-25 03:02:53 +03:00

1.4 KiB
Raw Permalink Blame History

[string.swap]

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);

1

#

Preconditions: allocator_traits::propagate_on_container_swap::value is true orget_allocator() == s.get_allocator().

2

#

Postconditions: this contains the same sequence of characters that was in s,s contains the same sequence of characters that was inthis.

3

#

Throws: Nothing.

4

#

Complexity: Constant time.