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