std::uses_allocator<std::stack>
From cppreference.com
C++
Containers library
(C++17) | ||||
| Sequence | ||||
(C++11) | ||||
(C++26) | ||||
(C++26) | ||||
(C++11) | ||||
| Associative | ||||
| Unordered associative | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Adaptors | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Views | ||||
(C++20) | ||||
(C++23) | ||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
std::stack| Member functions | ||||
| Element access | ||||
| Capacity | ||||
| Modifiers | ||||
(C++23) | ||||
(C++11) | ||||
(C++11) | ||||
| Non-member functions | ||||
(C++11) | ||||
| Helper classes | ||||
uses_allocator<std::stack> (C++11) | ||||
(C++23) | ||||
| Deduction guides(C++17) |
| Defined in header <stack>
|
||
| template< class T, class Container, class Alloc > struct uses_allocator<std::stack<T, Container>, Alloc> |
(since C++11) | |
Provides a transparent specialization of the std::uses_allocator type trait for std::stack: the container adaptor uses allocator if and only if the underlying container does.
Contents |
Inherited from std::integral_constant
Member constants
| value [static] |
true (public static member constant) |
Member functions
| operator bool |
converts the object to bool, returns value (public member function) |
| operator() (C++14) |
returns value (public member function) |
Member types
| Type | Definition |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
[edit] Example
Run this code
#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() {}
[edit] See also
| (C++11) |
checks if the specified type supports uses-allocator construction (class template) [edit] |