public static member function
<memory>

std::allocator_traits::construct

template <class T, class... Args>
  static void construct (allocator_type alloc, T* p, Args&&... args );
Construct an element
Constructs an element object in place on the location pointed by p forwarding Args to its constructor.

Notice that the object is constructed in-place without allocating storage for the element.

In the non-specialized definition of allocator_traits, this member function effectively calls:
alloc.construct(p,forward<Args>(args)...)

if such a call is well formed. Otherwise, it invokes:
::new (static_cast<void*>(p)) T (forward<Args>(args)...)

A specialization for a specific allocator type may provide a different definition.

Parameters

alloc
Allocator object
allocator_type is an alias of allocator_traits's template parameter.
p
Pointer to a block of storage.
args
Arguments forwarded to the constructor.
Args is a list of zero or more types.

Return value

none

See also