std:: uses_allocator <std::function>
From cppreference.net
<
cpp
|
utility
|
functional
|
function
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Function objects
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::function
| Member functions | ||||
|
(until C++17)
|
||||
| Non-member functions | ||||
|
(until C++20)
|
||||
| Helper classes | ||||
|
uses_allocator
<std::function>
(until C++17)
|
||||
| Deduction guides (C++17) |
|
定義先ヘッダ
<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 > |
関連項目
|
(C++11)
|
指定された型がuses-allocator構築をサポートするかどうかをチェックする
(クラステンプレート) |