std::uses_allocator<std::flat_set>
來自 cppreference.com
在標頭檔案 <flat_set> 中定義 |
||
template< class Key, class Compare, class KeyContainer, class Allocator > struct uses_allocator<std::flat_set<Key, Compare, KeyContainer>, Allocator> |
(C++23 起) | |
為 std::flat_set 提供 std::uses_allocator 型別特性的透明特化:當且僅當底層容器使用分配器時,該容器介面卡才使用分配器。
目錄 |
繼承自 std::integral_constant
成員常量
值 [靜態] |
true (public static 成員常量) |
成員函式
operator bool |
將物件轉換為 bool,返回 value (公開成員函式) |
operator() (C++14) |
返回 value (公開成員函式) |
成員型別
型別 | 定義 |
value_type
|
bool |
型別
|
std::integral_constant<bool, value> |
[編輯] 示例
執行此程式碼
#include <memory> #include <flat_set> static_assert( std::uses_allocator<std::flat_set<int>, void>::value == false && std::uses_allocator<std::flat_set<int>, std::allocator<int>>::value == true ); int main() {}
[編輯] 參閱
(C++11) |
檢查指定型別是否支援 uses-allocator 構造 (類模板) |