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