Namespaces
Variants

std:: swap (std::polymorphic)

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
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)
Definiert im Header <memory>
constexpr void swap ( polymorphic & lhs, polymorphic & rhs )
noexcept ( noexcept ( lhs. swap ( rhs ) ) ) ;
(seit C++26)

Überlädt den std::swap -Algorithmus für std::polymorphic . Tauscht den Zustand von lhs mit dem von rhs aus. Ruft effektiv lhs. swap ( rhs ) auf.

Parameter

lhs, rhs - polymorphic Objekte, deren Zustände ausgetauscht werden sollen

Beispiel

Siehe auch

tauscht die Inhalte aus
(öffentliche Elementfunktion)