std::uses_allocator<std::queue>
出自cppreference.com
在標頭 <queue> 定義
|
||
template< class T, class Container, class Alloc > struct uses_allocator<std::queue<T, Container>, Alloc> |
(C++11 起) | |
為 std::queue 提供 std::uses_allocator 類型特徵的透明特化:當且僅當底層容器使用分配器時,容器適配器使用分配器。
目錄 |
繼承自 std::integral_constant
成員常量
value [靜態] |
true (公開靜態成員常量) |
成員函數
operator bool |
將對象轉換到 bool,返回 value (公開成員函數) |
operator() (C++14) |
返回 value (公開成員函數) |
成員類型
類型 | 定義 |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
示例
運行此代碼
#include <memory> #include <queue> static_assert( std::uses_allocator<std::queue<int>, void>::value == false && std::uses_allocator<std::queue<int>, std::allocator<int>>::value == true ); int main() {}
參閱
(C++11) |
檢查指定的類型是否支持使用分配器的構造 (類模板) |