deque::get_allocator
Vrátí kopii přidělování objekt použitý k vytvoření deque.
Allocator get_allocator( ) const;
Vrácená hodnota
Alokátor používá deque.
Poznámky
Allocators deque třídy určete způsob, jakým třída spravuje úložiště.Výchozí allocators, dodávané s STL kontejner třídy jsou dostačující pro většinu potřeb programování.Zápis a pomocí vlastní třídu přidělování je rozšířená C++.
Příklad
// 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
}
Požadavky
Záhlaví: <deque>
Obor názvů: std