basic_string::allocator_type

A type that represents the allocator class for a string object.

typedef Allocator allocator_type;

Remarks

The type is a synonym for the template parameter Allocator.

Example

// 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
}

Requirements

Header: <string>

Namespace: std

See Also

Reference

basic_string Class