deque::get_allocator
Возвращает копию объекта выделения, используемого для построения deque.
Allocator get_allocator( ) const;
Возвращаемое значение
Механизм распределения, используемый deque.
Заметки
Allocators для класса deque определяют, как класс управляет хранением.По умолчанию allocators, поставляемые с классами контейнеров STL достаточны для большинства необходимостей программирования.Создание и использование собственного класса распределитель раздел дополнительно C++.
Пример
// deque_get_allocator.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>
int main( )
{
using namespace std;
// The following lines declare objects that use the default allocator.
deque <int> c1;
deque <int, allocator<int> > c2 = deque <int, allocator<int> >( allocator<int>( ) );
// c3 will use the same allocator class as c1
deque <int> c3( c1.get_allocator( ) );
deque <int>::allocator_type xlst = c1.get_allocator( );
// You can now call functions on the allocator class used by c1
}
Требования
заголовок: <deque>
std пространство имен: