public member function
<memory>

std::allocator::construct

void construct ( pointer p, const_reference val );
template <class U, class... Args>  void construct (U* p, Args&&... args);
Construct an object
Constructs an element object on the location pointed by p.

Notice that this does not allocate space for the element. It should already be available at p (see member allocate to allocate space).

The function constructs an object of member type value_type (an alias of allocator's template parameter) using its copy constructor to initialize its value to a copy of val, as if the following code was used:
new ((void*)p) value_type (val);
The function constructs an object of type U in-place by forwarding its arguments to the appropriate constructor, as if the following code was used:
::new ((void*)p) U (forward<Args>(args)...);

Parameters

p
Pointer to a location with enough storage space to contain an element of type value_type.
pointer is a member type (defined as an alias of T* in std::allocator<T>).
val
Value to initialize the construced element to.
const_reference is a member type (defined as an alias of T& in std::allocator<T>).
p
Pointer to a location with enough storage space to contain an element of type U.
args
Arguments forwarded to the constructor.
Args is a list of zero or more types.

Return value

none

See also