1.8 KiB
[indirect.swap]
20 Memory management library [mem]
20.4 Types for composite class design [mem.composite.types]
20.4.1 Class template indirect [indirect]
20.4.1.7 Swap [indirect.swap]
constexpr void swap(indirect& other) noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value || allocator_traits<Allocator>::is_always_equal::value);
Preconditions: Ifallocator_traits::propagate_on_container_swap::value is true, thenAllocator meets the Cpp17Swappable requirements.
Otherwise get_allocator() == other.
get_allocator() is true.
Effects: Swaps the states of *this and other, exchanging owned objects or valueless states.
If allocator_traits::propagate_on_container_swap::value is true, then the allocators of *this and other are exchanged by calling swap as described in [swappable.requirements].
Otherwise, the allocators are not swapped.
[Note 1:
Does not call swap on the owned objects directly.
â end note]
constexpr void swap(indirect& lhs, indirect& rhs) noexcept(noexcept(lhs.swap(rhs)));
Effects: Equivalent to lhs.swap(rhs).