[#BloombergLP-bsltf-StdStatefulAllocator-allocate] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::xref:BloombergLP/bsltf/StdStatefulAllocator.adoc[StdStatefulAllocator]::allocate :relfileprefix: ../../../ :mrdocs: Allocate space for the specified number of `TYPE` objects. == Synopsis Declared in `<bsltf_stdstatefulallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- TYPE* allocate(xref:BloombergLP/bslma/Allocator/size_type.adoc[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 [cols="1,4"] |=== | Name| Description | *numElements* | number of `TYPE` objects to allocate space for |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#