Allocate space for the specified number of TYPE objects.

Synopsis

Declared in <bsltf_stdstatefulallocator.h>

TYPE*
allocate(bslma::Allocator::size_type numElements);

Description

Allocate enough (properly aligned) space for the specified numElements of the (template parameter) type TYPE. If the underlying bslma::Allocator is unable to fulfill the allocation request, an exception (typically bsl::bad_alloc) will be thrown.

Return Value

pointer to the allocated storage

Parameters

Name

Description

numElements

number of TYPE objects to allocate space for

Created with MrDocs