Namespaces
Variants

std:: allocator_arg, std:: allocator_arg_t

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)
定義済みヘッダー <memory>
struct allocator_arg_t { explicit allocator_arg_t ( ) = default ; } ;
(1) (C++11以降)
constexpr std:: allocator_arg_t allocator_arg { } ;
(2) (C++11以降)
(C++17以降インライン)
1) std::allocator_arg_t は、アロケータ対応オブジェクトのコンストラクタおよびメンバ関数のオーバーロードを区別するために使用される空のクラス型です。これには、 std::tuple std::function std::packaged_task (C++17まで) および std::promise が含まれます。
2) std::allocator_arg ( 1 ) のインスタンスであり、そのような許可された型のコンストラクタおよびメンバ関数に渡すことができます。

欠陥報告

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

DR Applied to Behavior as published Correct behavior
LWG 2510 C++11 デフォルトコンストラクタが非explicitであり、曖昧さを引き起こす可能性があった explicitに変更

関連項目

指定された型がuses-allocator構築をサポートするかどうかをチェックする
(クラステンプレート)