[#bsl-allocator_traits-0108-construct]
= xref:bsl.adoc[bsl]::xref:bsl/allocator_traits-0108.adoc[allocator&lowbar;traits]::construct
:relfileprefix: ../../
:mrdocs:

Construct an object of (template parameter) type `ELEMENT&lowbar;TYPE` at the specified `elementAddr`, either by 1) calling the `construct` method on `basicAllocator` with `elemAddr` and the specified (variable number of) `arguments` if the (template parameter) type `ALLOCATOR&lowbar;TYPE` defines such a method, or 2) forwarding the specified (variable number of) `arguments` to the constructor of `ELEMENT&lowbar;TYPE` directly (and ignoring `basicAllocator`) otherwise&period; The behavior is undefined unless `elementAddr` refers to valid, uninitialized storage&period;

== Synopsis

Declared in `&lt;bslma&lowbar;allocatortraits&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class ELEMENT&lowbar;TYPE,
    class&period;&period;&period; Args&gt;
static
void
construct(
    ALLOCATOR&lowbar;TYPE& basicAllocator,
    ELEMENT&lowbar;TYPE* elementAddr,
    Args&&&period;&period;&period; arguments);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
