Construct an ELEMENT_TYPE object at elementAddr.

Synopsis

Declared in <bslma_allocatortraits.h>

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

Description

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.

Parameters

Name

Description

basicAllocator

allocator used for construction if it provides construct

elementAddr

address at which to construct the object

arguments

constructor arguments forwarded to ELEMENT_TYPE

Created with MrDocs