[#bsl-allocator_traits-0ae-allocate-02] = xref:bsl.adoc[bsl]::xref:bsl/allocator_traits-0ae.adoc[allocator_traits<std::allocator<ALLOCATOR_TYPE>>]::allocate :relfileprefix: ../../ :mrdocs: Allocate memory. == Synopses Declared in `<bslma_allocatortraits.h>` Allocate memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr static pointer xref:bsl/allocator_traits-0ae/allocate-07.adoc[allocate]( _Alloc& __a, size_type __n); ---- [.small]#xref:bsl/allocator_traits-0ae/allocate-07.adoc[_» more..._]# Allocate memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr static pointer xref:bsl/allocator_traits-0ae/allocate-01.adoc[allocate]( _Alloc& __a, size_type __n, const_void_pointer __hint); ---- [.small]#xref:bsl/allocator_traits-0ae/allocate-01.adoc[_» more..._]# == Return Value Memory of suitable size and alignment for _n_ objects of type `value_type` [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *__a* | An allocator. | *__n* | The number of objects to allocate space for. | *__hint* | Aid to locality. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#