The get_allocator() method of unordered_set is the part of Standard Template Library(STL) of C++. This method gets the stored allocator object and returns it.
Allocator_type get_allocator() const;
where allocator_type is the type of the allocator used by the container.
Return Value: It returns the allocator object used to construct the container.
Exceptions: In this method, Exception is thrown if any element comparison object throws exception.
Below program illustrate the unordered_set::get_allocator() function
Is allocator Pair
It takes constant(O(1)) time of complexity to perform an operation.
Program 2 :
Allocated size = 64
- SDL library in C/C++ with examples
- feclearexcept in C++ with Examples
- iswprint() in C/C++ with Examples
- set_symmetric_difference in C++ with Examples
- iswgraph() in C/C++ with Examples
- std::allocator() in C++ with Examples
- ratio_not_equal() in C++ with examples
- cauchy_distribution a() in C++ with Examples
- ratio_equal() in C++ with examples
- mbrtoc32() in C/C++ with Examples
- mbrtoc16() in C/C++ with Examples
- std::mismatch() with examples in C++
- wmemset() in C/C++ with Examples
- memset() in C with examples
- Pointers in C/C++ with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.