VOOZH about

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

⇱ map get_allocator in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

map get_allocator in C++ STL

Last Updated : 11 Jul, 2025
map::get_allocator() is a built in function in C++ STL which is used to get allocator of container map. Syntax:
Allocator_type get_allocator()
Parameters: This function does not accept any parameter. Return value: Returns an allocator associated with map. Below programs explains clearly the map::get_allocator() function. Example-1:
Output:
Is allocator Pair
Example-2:
Output:
Allocated size = 64
Comment
Article Tags: