Namespaces
Variants

std::scoped_allocator_adaptor<OuterAlloc,InnerAlloc...>:: scoped_allocator_adaptor

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)
ヘッダーで定義 <scoped_allocator>
scoped_allocator_adaptor ( ) ;
(1) (C++11以降)
template < class OuterA2 >

scoped_allocator_adaptor (
OuterA2 && outerAlloc, const InnerAllocs & ... innerAllocs

) noexcept ;
(2) (C++11以降)
scoped_allocator_adaptor (

const scoped_allocator_adaptor & other

) noexcept ;
(3) (C++11以降)
scoped_allocator_adaptor (

scoped_allocator_adaptor && other

) noexcept ;
(4) (C++11以降)
template < class OuterA2 >

scoped_allocator_adaptor (
const scoped_allocator_adaptor < OuterA2, InnerAllocs... > & other

) noexcept ;
(5) (C++11以降)
template < class OuterA2 >

scoped_allocator_adaptor (
scoped_allocator_adaptor < OuterA2, InnerAllocs... > && other

) noexcept ;
(6) (C++11以降)
1) デフォルトコンストラクタ: OuterAlloc 基底クラスと、実装で使用される場合の内部アロケータメンバオブジェクトを値初期化します。
2) 基底クラス OuterAlloc std:: forward < OuterA2 > ( outerAlloc ) から構築し、内部アロケータを innerAllocs... で構築します。このオーバーロードは、 std:: is_constructible < OuterAlloc, OuterA2 > :: value true の場合にのみオーバーロード解決に参加します。
3) コピーコンストラクタ: 各アロケータを other の対応するアロケータから初期化します。
4) ムーブコンストラクタ: 対応するアロケータを other から * this へ移動します。
5) 対応する other のアロケータから各アロケータを初期化します。このオーバーロードは、 std:: is_constructible < OuterAlloc, const OuterA2 & > :: value true の場合にのみオーバーロード解決に参加します。
6) 対応する other のアロケータから各アロケータをムーブセマンティクスを使用して初期化します。このオーバーロードは、 std:: is_constructible < OuterAlloc, OuterA2 > :: value true の場合にのみオーバーロード解決に参加します。

パラメータ

outerAlloc - 外部アロケータのコンストラクタ引数
innerAllocs... - 内部アロケータのコンストラクタ引数
other - 他の std::scoped_allocator_adaptor

欠陥報告

以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR 適用対象 公開時の動作 正しい動作
LWG 2782 C++11 OuterA2 を受け取るコンストラクタが制約されていなかったため、メタプログラミングに干渉していた 制約が追加された

関連項目

外側のアロケータを使用して未初期化のストレージを割り当てる
(public member function)
割り当てられたストレージ内にオブジェクトを構築し、適切な場合は内側のアロケータをそのコンストラクタに渡す
(public member function)