std::polymorphic<T, Allocator>:: swap
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
constexpr
void
swap
(
polymorphic
&
other
)
noexcept
(
/* 下記参照 */
)
;
|
(C++26 以降) | |
内容を other の内容と交換します。
以下の説明において、 swap_allocators は std:: allocator_traits < Allocator > :: propagate_on_container_swap :: value を指します。
* this と other の状態を交換し、所有するオブジェクトまたは無効状態を入れ替えます。
-
swap_allocators
が
true
の場合、
using
std::
swap
;
swap (alloc , other.alloc ) ; を実行します。 - それ以外の場合、アロケータは交換されません。
以下のいずれかの条件が満たされる場合、動作は未定義となります:
-
swap_allocators
が
true
であり、かつ
Allocatorが Swappable 要件を満たさない場合。 - swap_allocators が false であり、かつ get_allocator ( ) == other. get_allocator ( ) が false である場合。
目次 |
パラメータ
| その他 | - |
内容を交換する
polymorphic
オブジェクト
|
例外
|| std:: allocator_traits < Allocator > :: is_always_equal :: value )
例
|
このセクションは不完全です
理由: 例がありません |
関連項目
|
(C++26)
|
std::swap
アルゴリズムを特殊化
(関数テンプレート) |