std::uses_allocator<std::function>
From ja.cppreference.net
| ヘッダ <functional>
|
||
template< class R, class... ArgTypes, class Alloc >
struct uses_allocator<std::function<R(ArgTypes...)>, Alloc> : std::true_type { };
|
で定義 (C++11以上) (C++17まで) |
|
この std::uses_allocator の特殊化は、std::function 型のオブジェクトが全て、入れ子の アロケータ使用構文 をサポートしていることを、他のライブラリコンポーネントに通知します。ただし、これらの型に allocator_type が存在しない場合でも同様です。
注記
std::function
のアロケータサポートは、仕様が不十分で実装も一貫していませんでした。一部の実装ではuses-allocator構築を全くサポートしておらず、一部は必要なコンストラクタオーバーロードを提供しているものの提供されたアロケータ引数を無視し、また一部はオーバーロードを提供し構築時には提供されたアロケータを使用するものの、
std::function
が再代入される際には使用しません。この結果、C++17ではアロケータサポートが削除されました。
std:: integral_constant から継承
メンバ定数
|
value
[static]
|
true
(public static member constant) |
メンバ関数
|
operator bool
|
オブジェクトを
bool
に変換し、
value
を返す
(public member function) |
|
operator()
(C++14)
|
value
を返す
(public member function) |
メンバ型
| 型 | 定義 |
value_type
|
bool |
type
|
std:: integral_constant < bool , value > |
関連項目
|
(C++11)
|
指定された型がuses-allocator構築をサポートするかどうかをチェックする
(クラステンプレート) |