|
allocator::allocatepublic member function
pointer allocate (size_type n, allocator<void>::const_pointer hint=0); Allocate block of storage Attempts to allocate a block of storage with a size large enough to contain n elements of type T (the allocator's template parameter), and returns a pointer to the first element.The storage is aligned appropriately for objects of type T, but they are not constructed. In the default allocator, the block of storage is allocated using ::operator new one or more times, and throws bad_alloc if it cannot allocate the total amount of storage requested. Parameters
Return valueA pointer to the initial element in the block of storage.allocator throws bad_alloc if it cannot allocate the requested amount of storage. In allocator, member type pointer is an alias of T*.[/dd] See also
|