unordered_multimap get_allocator in C++ STL Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report unordered_multimap::get_allocator() is a built in function in C++ STL which is used to get allocator of container unordered_mulitmap. Syntax: Allocator_type get_allocator() Parameters: This function does not accept any parameter. Return value: Returns an allocator associated with unordered_multimap. Below programs illustrate the working of unordered_multimap::get_allocator() function. Example-1: CPP // CPP program to illustrate // unordered_multimap get_allocator() #include <bits/stdc++.h> using namespace std; int main() { //'ump' is object of 'unordered_multimap' unordered_multimap<int, int> ump; //'allocator_type' is inherit in 'unordered_multimap' //'u' is object of 'allocator_type' unordered_multimap<int, int>::allocator_type u = ump.get_allocator(); // Comparing the Allocator with Pair<int, int> cout << "Is allocator Pair<int, int> : " << boolalpha << (u == allocator<pair<int, int> >()); return 0; } Output:Is allocator Pair : true Example-2: CPP // CPP program to illustrate // unordered_multimap get_allocator() #include <bits/stdc++.h> using namespace std; int main(void) { unordered_multimap<char, int> um; pair<const char, int>* a; a = um.get_allocator().allocate(8); cout << "Allocated size = " << sizeof(*a) * 8 << endl; return 0; } Output:Allocated size = 64 Time complexity: O(1). Auxiliary space: O(1). Comment More infoAdvertise with us Next Article unordered_multimap erase in C++ STL A ankit15697 Follow Improve Article Tags : C++ STL cpp-unordered_multimap cpp-unordered_map-functions Practice Tags : CPPSTL Similar Reads unordered_map get_allocator in C++ STL unordered_map::get_allocator() is a built in function in C++ STL which is used to get allocator of container unordered_map. Syntax Allocator_type get_allocator() Parameters: This function does not accept any parameter. Return value: Returns an allocator associated with unordered_map. Below programs 1 min read unordered_multiset get_allocator in C++ STL The unordered_multiset::get_allocator() function is a STL function in C++ which is used to include unorder_multiset header file in program. This function gets the stored allocator object and returns the allocator object which is used to construct the container. It is a public member function. Syntax 1 min read Unordered Multimap in C++ STL In C++, the unordered_multimap is an unordered associative container that stores data in the form of key-value pairs. It is similar to unordered map, but it allows multiple elements with the same key. It provides fast insertion, deletion and search operations in O(1) time by using hashing.Example:C+ 7 min read map get_allocator in C++ STL 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 1 min read unordered_multimap erase in C++ STL unordered_multimap::erase() is a built in function in C++ STL which removes the element from given range, by position and by key. There are three variant of this function in C++ STL. There are following type of erase() functions in C++ for unordered_multimap. By position : It removes element from un 4 min read multimap get_allocator() function in C++ STL The multimap::get_allocator() is a function in STL in C++ that returns the copy of allocator object associated with this multimap. Syntax: multimap.get_allocator() Return value: This function returns the copy of the allocator object associated with this multimap. Below example illustrate the get_all 2 min read Like