std::polymorphic<T, Allocator>:: operator=
From cppreference.net
<
cpp
|
memory
|
polymorphic
|
constexpr
polymorphic
&
operator
=
(
const
polymorphic
&
other
)
;
|
(1) | (C++26以降) |
|
constexpr
polymorphic
&
operator
=
(
polymorphic
&&
other
)
noexcept ( /* 下記参照 */ ) ; |
(2) | (C++26以降) |
* this の内容を other の内容で置き換えます。
traits
を
std::
allocator_traits
<
Allocator
>
とします:
1)
もし
std::
addressof
(
other
)
==
this
が
true
の場合、何も行わない。それ以外の場合、
need_update
を
traits
::
propagate_on_container_copy_assignment
::
value
とする:
2)
もし
std::
addressof
(
other
)
==
this
が
true
の場合、何も行わない。それ以外の場合、
need_update
を
traits
::
propagate_on_container_move_assignment
::
value
とする:
*this と other が所有するオブジェクトを更新した後、
*
this
および
other
において、
need_update
が
true
の場合、
alloc
は
other.
alloc
のコピーで置き換えられます。
以下の条件がすべて満たされる場合、プログラムは不適格(ill-formed)である:
- std:: allocator_traits < Allocator > :: is_always_equal :: value が false である。
-
Tが不完全型(incomplete type)である。
目次 |
パラメータ
| その他 | - |
代入に使用される所有値(存在する場合)を持つ別の
polymorphic
オブジェクト
|
戻り値
* this
例外
1)
例外がスローされた場合、
*
this
に対する影響はありません。
2)
例外がスローされた場合、
*
this
または
other
に対する影響はありません。
noexcept
指定:
noexcept
(
std::
allocator_traits
<
Allocator
>
::
propagate_on_container_move_assignment
::
value
例
|
このセクションは不完全です
理由: 例がありません |