다음을 통해 공유


basic_string::allocator_type

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

typedef Allocator allocator_type;

설명

The type is a synonym for the template parameter 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
}

요구 사항

헤더: <string>

네임스페이스: std

참고 항목

참조

basic_string 클래스