Partager via


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
    );

Parameters

Parameter

Description

_Args

Allocated objects for which a shared_ptr is to be created.

Property Value/Return Value

Returns a shared_ptr that points to the allocated objects.

Remarks

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

Requirements

Header: <memory>

Namespace: std

See Also

Reference

<memory>

shared_ptr Class

Other Resources

<memory> Members