C++ Multiset get_allocator()C++ Multiset get_allocator() function is used to return the copy of allocator object which helps to construct the multiset container. SyntaxParameterNone Return valueget_alloactor() function returns an allocator associated with multiset container. ComplexityConstant. Iterator validityNo changes. Data RacesThe container is accessed. Concurrently accessing the elements of multiset is safe. Exception SafetyThis function never throws exceptions. Example 1Let's see the simple example: Output: Allocated size = 32 Example 2Let's see a simple example: Output: The allocated array contains: 10 20 30 40 50 Example 3Let's see a simple example to check whether the allocators are interchangeable or not: Output: The number of integers that can be allocated before free memory is exhausted: 461168601842738790. The number of doubles that can be allocated before free memory is exhausted: 461168601842738790. The allocators are interchangeable. Example 4Let's see a simple example: Output: 42, 43 Next TopicC++ multiset |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India