表示字符串对象的分配程序类的类型。
typedef Allocator allocator_type;
备注
类型作为模板参数的 Allocator的同义词。
示例
// basic_string_allocator_type.cpp
// compile with: /EHsc
#include <string>
#include <iostream>
int main( )
{
using namespace std;
// The following lines declare objects
// that use the default allocator.
string s1;
basic_string <char>::allocator_type xchar = s1.get_allocator( );
// You can now call functions on the allocator class xchar used by s1
}
要求
标头:< 字符串>
命名空间: std