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)
定義先ヘッダ <memory>
constexpr void swap ( polymorphic & lhs, polymorphic & rhs )
noexcept ( noexcept ( lhs. swap ( rhs ) ) ) ;
(C++26以降)

std::swap アルゴリズムを std::polymorphic に対してオーバーロードします。 lhs の状態と rhs の状態を交換します。実質的に lhs. swap ( rhs ) を呼び出します。

パラメータ

lhs, rhs - polymorphic 状態を交換するオブジェクト

関連項目

内容を交換する
(公開メンバ関数)