VOOZH about

URL: https://www.geeksforgeeks.org/cpp/deque-get_allocator-in-c-stl/

⇱ deque get_allocator in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

deque get_allocator in C++ STL

Last Updated : 11 Jul, 2025

deque::get_allocator() is a built in function in C++ STL which is used to get allocator of container deque. Syntax: 

Allocator_type get_allocator()

Parameters: This function does not accept any parameter. Return value: Returns an allocator associated with deque. Below programs illustrate the working of deque::get_allocator() function. Example-1: 

Output:
Is allocator Pair : true

Example-2: 

Output:
0 1 2

Time complexity: O(1).

Auxiliary Space:  O(n). // n is the size of the deque.

Comment
Article Tags: