std::uses_allocator<std::function>
來自 cppreference.com
定義於標頭檔案 <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 的所有物件都支援*uses-allocator 構建*,儘管它們沒有巢狀的 allocator_type
。
目錄 |
[編輯] 註解
std::function
的分配器支援定義不佳且實現不一致。某些實現根本不支援 uses-allocator 構建,某些提供所需的建構函式過載但忽略提供的分配器引數,還有些提供過載並使用提供的分配器進行構建,但在 std::function
被重新賦值時卻不使用。因此,分配器支援在 C++17 中被移除。
繼承自 std::integral_constant
成員常量
值 [靜態] |
true (public static 成員常量) |
成員函式
operator bool |
將物件轉換為 bool,返回 value (公開成員函式) |
operator() (C++14) |
返回 value (公開成員函式) |
成員型別
型別 | 定義 |
value_type
|
bool |
型別
|
std::integral_constant<bool, value> |
[編輯] 參閱
(C++11) |
檢查指定型別是否支援 uses-allocator 構造 (類模板) |