std::polymorphic<T, Allocator>::swap - cppreference.com (original) (raw)

| constexpr void swap( polymorphic& 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 one of the following conditions is satisfied, the behavior is undefined:

[edit] Parameters

other - the polymorphic object to exchange the contents with

[edit] Exceptions

[edit] Example

[edit] See also