allocator_traits 클래스
The template class describes an object that supplements an allocator type. An allocator type is any type that describes an allocator object that is used for managing allocated storage. Specifically, for any allocator type Alloc, you can use allocator_traits<Alloc> to determine all the information that is needed by an allocator-enabled container. For more information, see the default allocator 클래스.
template<class Alloc>
class allocator_traits;
형식 정의
Name |
설명 |
---|---|
allocator_traits::allocator_type |
This type is a synonym for the template parameter Alloc. |
allocator_traits::const_pointer |
This type is Alloc::const_pointer, if that type is well-formed; otherwise, this type is pointer_traits<pointer>::rebind<const value_type>. |
allocator_traits::const_void_pointer |
This type is Alloc::const_void_pointer, if that type is well-formed; otherwise, this type is pointer_traits<pointer>::rebind<const void>. |
allocator_traits::difference_type |
This type is Alloc::difference_type, if that type is well-formed; otherwise, this type is pointer_traits<pointer>::difference_type. |
allocator_traits::pointer |
This type is Alloc::pointer, if that type is well-formed; otherwise, this type is value_type *. |
allocator_traits::propagate_on_container_copy_assignment |
This type is Alloc::propagate_on_container_copy_assignment, if that type is well-formed; otherwise, this type is false_type. |
allocator_traits::propagate_on_container_move_assignment |
This type is Alloc::propagate_on_container_move_assignment, if that type is well-formed; otherwise, this type is false_type. If the type holds true, an allocator-enabled container copies its stored allocator on a move assignment. |
allocator_traits::propagate_on_container_swap |
This type is Alloc::propagate_on_container_swap, if that type is well-formed; otherwise, this type is false_type. If the type holds true, an allocator-enabled container swaps its stored allocator on a swap. |
allocator_traits::size_type |
This type is Alloc::size_type, if that type is well-formed; otherwise, this type is make_unsigned<difference_type>::type. |
allocator_traits::value_type |
This type is a synonym for Alloc::value_type. |
allocator_traits::void_pointer |
This type is Alloc::void_pointer, if that type is well-formed; otherwise, this type is pointer_traits<pointer>::rebind<void>. |
정적 메서드
The following static methods call the corresponding method on a given allocator parameter.
Name |
설명 |
---|---|
Static method that allocates memory by using the given allocator parameter. |
|
Static method that uses a specified allocator to construct an object. |
|
Static method that uses a specified allocator to deallocate a specified number of objects. |
|
Static method that uses a specified allocator to call the destructor on an object without deallocating its memory. |
|
Static method that uses a specified allocator to determine the maximum number of objects that can be allocated. |
|
Static method that calls select_on_container_copy_construction on the specified allocator. |
요구 사항
헤더 <memory>
네임스페이스: std