std::allocator_traits
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   定义于头文件  <memory>
  | 
||
|   template< class Alloc > struct allocator_traits;  | 
(C++11 起) | |
allocator_traits 类模板提供访问分配器 (Allocator) 各种属性的标准化方式。标准容器和其他标准库组件通过此模板访问分配器,这使得能以任何类类型为分配器,只要用户提供的 allocator_traits 特化实现所有要求的功能。
默认的非特化 allocator_traits 含有下列成员:
成员类型
| 类型 | 定义 | 
  allocator_type
 | 
Alloc | 
  value_type
 | 
Alloc::value_type | 
  pointer
 | 
若存在则为 Alloc::pointer ,否则为 value_type* | 
  const_pointer
 | 
若存在则为 Alloc::const_pointer ,否则为 std::pointer_traits<pointer>::rebind<const value_type> | 
  void_pointer
 | 
若存在则为 Alloc::void_pointer ,否则为 std::pointer_traits<pointer>::rebind<void> | 
  const_void_pointer
 | 
若存在则为 Alloc::const_void_pointer ,否则为 std::pointer_traits<pointer>::rebind<const void> | 
  difference_type
 | 
若存在则为 Alloc::difference_type ,否则为 std::pointer_traits<pointer>::difference_type | 
  size_type
 | 
若存在则为 Alloc::size_type ,否则为 std::make_unsigned<difference_type>::type | 
  propagate_on_container_copy_assignment
 | 
若存在则为 Alloc::propagate_on_container_copy_assignment ,否则为 std::false_type | 
  propagate_on_container_move_assignment
 | 
若存在则为 Alloc::propagate_on_container_move_assignment ,否则为 std::false_type | 
  propagate_on_container_swap
 | 
若存在则为 Alloc::propagate_on_container_swap ,否则为 std::false_type | 
  is_always_equal(C++17 起)
 | 
若存在则为 Alloc::is_always_equal ,否则为 std::is_empty<Alloc>::type | 
成员别名模版
| 类型 | 定义 | 
  rebind_alloc<T>
 | 
若存在则为 Alloc::rebind<T>::other ,否则若 Alloc<T, Args> 则为 Alloc<U, Args> | 
  rebind_traits<T>
 | 
std::allocator_traits<rebind_alloc<T>> | 
成员函数
|    [静态]  | 
   用分配器分配未初始化的存储  (公开静态成员函数)  | 
|    [静态]  | 
   用分配器解分配存储  (公开静态成员函数)  | 
|    [静态]  | 
   在分配的存储构造对象  (函数模板)  | 
|    [静态]  | 
  析构存储于已分配存储的对象  (函数模板)  | 
|    [静态]  | 
  返回分配器所支持的最大对象大小  (公开静态成员函数)  | 
|    获得复制标准容器后使用的分配器  (公开静态成员函数)  | 
参阅
|    默认的分配器   (类模板)  | |
|    (C++11)  | 
   为多级容器实现的多级分配器   (类模板)  | 
|    (C++11)  | 
   提供关于指针式类型的信息  (类模板)  |