std::indirect<T, Allocator>::swap
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
Uninitialized storage (until C++20)
(until C++20*)
(until C++20*)
(until C++20*)
Garbage collector support (until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
std::indirect
indirect::swap
constexpr void swap( indirect& other ) noexcept(/* see below */);
(since C++26)
Swaps the contents with those of other.
In the description below, swap_allocators refers to std::allocator_traits <Allocator>::propagate_on_container_swap::value.
Swaps the states of *this and other, exchanging owned objects or valueless states.
- If swap_allocators is true, then executes using std::swap ;
swap(alloc
, other.alloc
);. - Otherwise, the allocators are not swapped.
If one of the following conditions is satisfied, the behavior is undefined:
- swap_allocators is true, and
Allocator
does not satisfy the requirements of Swappable. - swap_allocators is false, and get_allocator() == other.get_allocator() is false.
Contents
[edit] Parameters
other
-
the
indirect
object to exchange the contents with
[edit] Exceptions
noexcept specification:
noexcept(std::allocator_traits <Allocator>::propagate_on_container_swap::value
|| std::allocator_traits <Allocator>::is_always_equal::value)
|| std::allocator_traits <Allocator>::is_always_equal::value)
[edit] Example
This section is incomplete
Reason: no example
Reason: no example