cpp/memory/shared ptr/make shared

@1@ Constructs an object of type and wraps it in a std using  as the parameter list for the constructor of. The object is constructed as if by the expression, where is an internal  pointer to storage suitable to hold an object of type. The storage is typically larger than in order to use one allocation for both the control block of the shared pointer and the  object. The constructor called by this function enables  with a pointer to the newly constructed object of type. @2,3@ Same as, but the object constructed is a possibly-multidimensional array whose non-array elements of type are value-initialized as if by placement-new expression. The overload creates an array of size  along the first dimension. The array elements are initialized in ascending order of their addresses, and when their lifetime ends are destroyed in the reverse order of their original construction. @4,5@ Same as, but every element is initialized from the default value. If is not an array type, then this is performed as if by the same placement-new expression as in ; otherwise, this is performed as if by initializing every non-array element of the (possibly multidimensional) array with the corresponding element from  with the same placement-new expression as in. The overload creates an array of size  along the first dimension. The array elements are initialized in ascending order of their addresses, and when their lifetime ends are destroyed in the reverse order of their original construction. @6@ Same as if  is not an array type and  if  is, except that the created object is default-initialized. @7@ Same as, except that the individual array elements are default-initialized.

In each case, the object will be destroyed by, where  is a pointer to the object and  is its type.

Return value
std of an instance of type.

Exceptions
May throw std or any exception thrown by the constructor of. If an exception is thrown, the functions have no effect.