[#BloombergLP-bslma-AllocatorUtil-allocateObject] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::allocateObject :relfileprefix: ../../../ :mrdocs: Allocate raw storage for one or more `t_TYPE` objects. == Synopsis Declared in `<bslma_allocatorutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_ALLOCATOR> static AllocatorUtil_Traits<t_ALLOCATOR, t_TYPE>::pointer allocateObject( t_ALLOCATOR const& allocator, std::size_t n = 1); ---- == Description Return a pointer to a block of raw memory allocated from the specified `allocator` having a size and alignment appropriate for an object of (templatize parameter) `t_TYPE`. Optionally specify `n` for the number of objects; otherwise space for a single object is allocated. Since `t_TYPE` cannot be deduced from the function parameters, it must be supplied explicitly (in `<>` brackets) by the caller. == Return Value pointer to raw storage suitably sized and aligned for `n` objects of type `t_TYPE` == Parameters [cols="1,4"] |=== | Name| Description | *allocator* | allocator from which to allocate | *n* | number of objects of type `t_TYPE` to allocate space for |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#