STL 컨테이너에서 사용할 메모리 모델을 정의하는 클래스.
메모리를 좀더 세밀하게 컨트롤을 할때 allocator를 사용한다.
템플릿 매개변수
멤버 타입
typedef T value_type;
typedef T* pointer;
typedef T& reference;
typedef const T* const_pointer;
typedef const T& const_reference;
typedef typename size_t size_type;
typedef typename ptrdiff_t difference_type;
typedef _member class_ rebind<Type>;
default (1)
allocator() throw();
copy (2)
allocator (const allocator& alloc) throw();
template <class U>
allocator (const allocator<U>& alloc) throw();
일반 allocator에는 인자가 없으며 초기화를 수행할 필요가 없지만 복사 생성자를 사용하려면 그들이 아무것도 하지 않더라도 세 개의 allocator 버전을 정의해야 합니다?.
(the three constructor versions must be defined (even if they do nothing) to allow for copy-constructions from allocator objects of other types.
)