|
list::get_allocatorpublic member function
allocator_type get_allocator() const; Get allocator Returns the allocator object used to constuct the container.ParametersnoneReturn ValueThe allocator.Member type allocator_type is defined to the same as the second template parameter used to instantitate this specific list 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 container. Output:
ComplexityConstant.
|