14.4.1  型别

14.4.1 型别

allocator::value_type:元素型别,相等于类模板中的T。例如allocator<T>。

allocator::size_type:一个无正负号的整数型别,表示应用程序模型中最大对象的大小。

allocator::different_type:一个有正负号的整数型别,表示分配模型中两个指针的差距。如果配合标准容器使用,此型别必须等于ptrdiff_t。

allocator::pointer:一个指向元素的指针型别。为配合标准容器的使用,此型别要等同于allocator<T>中的T

allocator::const_pointer:一个指向元素的常数指针型别。若配合标准容器使用,此型别必须等同于allocator<T>中的constT∗。

allocator::reference:一个指向元素的reference型别。此型别要等同于allocator<T>中的T&。

allocator::const_reference:一个指向元素的const reference型别。此型别要等同于alloca-tor<T>中的constT&。

allocator::rebind:这是一个模板结构体,可使配置器间接为其他型别分配空间。