make_shared (<memory>)

Creates and returns a shared_ptr that points to the allocated objects constructed from zero or more arguments using the default allocator.

template<class Type, class... Types>
    shared_ptr<Type> make_shared(
        Types&&... _Args
    );

Parameter

Description

_Args

Allocated objects for which a shared_ptr is to be created.

Returns a shared_ptr that points to the allocated objects.

The function creates the object shared_ptr<Type>, a pointer to Type(_Args...) as allocated and constructed by the default allocator allocator().

Header: <memory>

Namespace: std

Community Additions

ADD
Show: