bsl::allocator_traits::construct

Construct an object of (template parameter) type ELEMENT_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_TYPE defines such a method, or 2) forwarding the specified (variable number of) arguments to the constructor of ELEMENT_TYPE directly (and ignoring basicAllocator) otherwise. The behavior is undefined unless elementAddr refers to valid, uninitialized storage.

Synopsis

Declared in <bslma_allocatortraits.h>

template<
    class ELEMENT_TYPE,
    class... Args>
static
void
construct(
    ALLOCATOR_TYPE& basicAllocator,
    ELEMENT_TYPE* elementAddr,
    Args&&... arguments);