名稱空間
變體
操作

std::uses_allocator<std::flat_multiset>

來自 cppreference.com
 
 
 
 
在標頭檔案 <flat_set> 中定義
template< class Key, class Compare, class KeyContainer, class Allocator >

struct uses_allocator<std::flat_multiset<Key, Compare, KeyContainer>, Allocator>

    : std::bool_constant<std::uses_allocator_v<KeyContainer, Allocator>> {};
(C++23 起)

std::flat_multiset 提供了 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_multiset<int>, void>::value == false &&
    std::uses_allocator<std::flat_multiset<int>, std::allocator<int>>::value == true
);
 
int main() {}

[編輯] 參閱

檢查指定型別是否支援 uses-allocator 構造
(類模板) [編輯]