|
vector::get_allocatorpublic member function
allocator_type get_allocator() const; Get allocator Returns the allocator object used to construct the vector.ParametersnoneReturn ValueThe allocator.Member type allocator_type is defined to the same as the second template parameter used to instantitate this specific vector class (its Allocator type). Example
The example shows an elaborate way to allocate memory for an array of ints using the same allocator used by the vector. Output:
ComplexityConstant.
|