Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Creates a shared_ptr to objects that are allocated and constructed for a given type by using a specified allocator. Returns the shared_ptr.

template<class Type, class Allocator, class... Types>
    shared_ptr<Type> allocate_shared(
        Allocator _Alloc, 
        Types&&... _Args


The allocator used to create objects.


The zero or more arguments that become the objects.

Returns a shared_ptr that points to the allocated object.

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

Header: <memory>

Namespace: std


Other Resources

Community Additions

© 2015 Microsoft