chsvlib
chsv helper source code

◆ construct()

void construct ( U *  p,
arg_t &&...  args 
)

Constructs an object of the specified type within the specified uninitialized memory buffer.

Template Parameters
Uis a type of an object to be constructed.
arg_tis a pack of types of parameters to be passed to the constructor of the object.
Parameters
pis an output pointer to an uninitialized memory buffer of size, sufficient to hold the constructed object.
argsis a pack of parameters to be passed to the constructor of the object.

The method is a wrapper over the U constructor which is called to construct the object, written to the memory pointed to by p. The buffer is supposed to be enough to hold all the data, describing the object. The memory can be previously acquired by invoking the allocate method.