std::polymorphic<T, Allocator>:: polymorphic
|
constexpr
explicit
polymorphic
(
)
;
|
(1) | (C++26以降) |
|
constexpr
explicit
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a
)
;
|
(2) | (C++26以降) |
|
template
<
class
U
=
T
>
constexpr explicit polymorphic ( U && v ) ; |
(3) | (C++26以降) |
|
template
<
class
U
=
T
>
constexpr
explicit
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(4) | (C++26以降) |
|
template
<
class
U,
class
...
Args
>
constexpr explicit polymorphic ( std:: in_place_type_t < U > , Args && ... args ) ; |
(5) | (C++26以降) |
|
template
<
class
U,
class
...
Args
>
constexpr
explicit
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(6) | (C++26以降) |
|
template
<
class
U,
class
I,
class
...
Args
>
constexpr
explicit
polymorphic
(
std::
in_place_type_t
<
U
>
,
|
(7) | (C++26以降) |
|
template
<
class
U,
class
I,
class
...
Args
>
constexpr
explicit
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a,
|
(8) | (C++26以降) |
|
constexpr
polymorphic
(
const
polymorphic
&
other
)
;
|
(9) | (C++26以降) |
|
constexpr
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a,
const polymorphic & other ) ; |
(10) | (C++26以降) |
|
constexpr
polymorphic
(
polymorphic
&&
other
)
noexcept
;
|
(11) | (C++26以降) |
|
constexpr
polymorphic
(
std::
allocator_arg_t
,
const
Allocator
&
a,
polymorphic && other ) noexcept ( /* see below */ ) ; |
(12) | (C++26以降) |
新しい
polymorphic
オブジェクトを構築します。
目次 |
パラメータ
| a | - | 関連付けるアロケータ |
| v | - | 所有する値を初期化するための値 |
| args | - | 所有する値を初期化するための引数 |
| il | - | 所有する値を初期化するための初期化子リスト |
| other | - |
所有する値(存在する場合)がコピーされる別の
polymorphic
オブジェクト
|
効果
新しい
polymorphic
オブジェクトの構築は、以下の手順で構成されます:
alloc
を構築する
:
-
オーバーロード
(
1-8
)
の場合:
std::
allocator_traits
<
Allocator
>
::
construct
(
alloc ,p, args... ) を呼び出します。ここで-
p
は型
U*のポインタであり、構築される所有オブジェクトに適したストレージを指し、 - args... は初期化引数を含む式パックです。
-
p
は型
- オーバーロード ( 9-12 ) の場合:
| オーバーロード | 初期化子... | 所有オブジェクトの型 |
valueless_after_move()
構築後 |
|
|---|---|---|---|---|
alloc
|
所有オブジェクト | |||
| ( 1 ) | (空) | (空) |
T
|
false |
| ( 2 ) | a | |||
| ( 3 ) | (空) | std:: forward < U > ( v ) |
U
|
|
| ( 4 ) | a | |||
| ( 5 ) | (空) | std:: forward < Args > ( args ) | ||
| ( 6 ) | a | |||
| ( 7 ) | (空) |
ilist,
std:: forward < Args > ( args ) |
||
| ( 8 ) | a | |||
| ( 9 ) | 以下を参照 |
*
other
( other が値を所有している場合のみ) |
other が所有するオブジェクトの型 | true ( other がvaluelessの場合のみ) |
| ( 10 ) | a | |||
| ( 11 ) |
std
::
move
(
other.
alloc
)
|
所有権を取得
( other が値を所有している場合のみ) |
||
| ( 12 ) | a | 以下を参照 | ||
alloc
は
std::
allocator_traits
<
Allocator
>
::
select_on_container_copy_construction
(
other.
alloc
)
で直接非リスト初期化されます。
制約条件と補足情報
- std:: derived_from < std:: remove_cvref_t < U > , T >
- std:: is_copy_constructible_v < std:: remove_cvref_t < U >>
- std:: is_constructible_v < std:: remove_cvref_t < U > , /* argument types */ > 、ここで /* argument types */ は:
U
Args...
- std:: is_same_v < std:: remove_cvref_t < U > , std :: polymorphic > が false であること。
-
Uが std::in_place_type_t の特殊化ではないこと。
例外
std:: allocator_traits < Allocator > :: allocate または std:: allocator_traits < Allocator > :: construct が例外を送出しない限り、何も送出しません。
例
|
このセクションは不完全です
理由: 例がありません |
関連項目
|
(C++11)
|
アロケータ対応コンストラクタのオーバーロードを選択するために使用されるタグ型
(クラス) |
|
インプレース構築タグ
(タグ) |