1、 符合STL标准的空间配器接口
STL是c++中使用非常广泛的一个标准库,它包含各种有用的容器。而空间配置器作为STL各种容器的背后的核心,负责容器内部内存的分配和释放。不过空间配置器可以分配的也不只是内存,因为空间也意味着可以是磁盘或者其他存储介质。下边是一个符合STL规范的空间配置器的必要接口:
allocator::value_type
allocator::pointer
allocator::const_pointer
allocator::reference
allocator::const_reference
allocator::size_type
allocator::difference_type
//上边这几个都是一些typedef定义,其中 size_type 和difference_type是stddef.h中 size_t, ptrdiff_t这两个类型的类型别名(ptrdiff_t是两个指针相减的结果)
allocator::rebind
allocator::allocator
allocator::allocator(const allocator&)
template<class U>
alloc