std::uses_allocator<std::stack>
來自 cppreference.com
定義於標頭檔案 <stack> |
||
template< class T, class Container, class Alloc > struct uses_allocator<std::stack<T, Container>, Alloc> |
(C++11 起) | |
為 std::stack 提供 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 <stack> static_assert( std::uses_allocator<std::stack<int>, void>::value == false && std::uses_allocator<std::stack<int>, std::allocator<int>>::value == true ); int main() {}
[編輯] 參閱
(C++11) |
檢查指定型別是否支援 uses-allocator 構造 (類模板) |