The set::get_allocator() in C++ STL is an in-built function which returns the copy of the allocator object associated with the set.
Parameters: This function does not accept any parameters.
Return Value: This function returns the allocator associated with the set.
Time Complexity: O(1).
Below are the examples to illustrate set::get_allocator() method:
Example 1: The program below shows how allocator of a set can be used to allocate an array of 7 elements.
size of int pointer is: 8 0 1 2 3 4 5 6
- How to Become Google Developer Students Club (DSC) Lead ?
- Node.js | Export Module
- What is Hactoberfest and How One Can Take Participate in it?
- CSS | Combine background image with gradient overlay
- How to Design Half-Page Carousel in Bootstrap ?
- What is the meaning of let-* in Angular 2 Templates ?
- Difference between multiple arguments and options object
- How to Check Twitter Bootstrap is Loaded or not ?
- How to iterate through all selected elements into an array ?
- How to put images in a box without space using Bootstrap?
- Node.js | Buffer.alloc() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.