Namespaces
Variants

std:: uses_allocator <std::function>

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
定義先ヘッダ <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 の特殊化は、たとえネストされた allocator_type を持たなくても、すべての std::function 型のオブジェクトが アロケータ使用構築 をサポートすることを、他のライブラリコンポーネントに通知します。

目次

注記

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 >

関連項目

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