[#bsl-allocate_shared-0f]
= xref:bsl.adoc[bsl]::allocate&lowbar;shared
:relfileprefix: ../
:mrdocs:

Return a `shared&lowbar;ptr` object referring to and managing a new `ARRAY&lowbar;TYPE` object, where `ARRAY&lowbar;TYPE` is a bounded array&period; The specified `basicAllocator` will be used to supply a single contiguous region of memory holding the returned shared pointer&apos;s internal representation and the new `ARRAY&lowbar;TYPE` object, and each element in the array is default constructed&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;sharedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class ARRAY&lowbar;TYPE,
    class ALLOC&gt;
xref:bsl/shared_ptr-0a.adoc[bsl::shared&lowbar;ptr&lt;ARRAY&lowbar;TYPE&gt;]
allocate&lowbar;shared(ALLOC basicAllocator)
requires is&lowbar;bounded&lowbar;array&lt;ARRAY&lowbar;TYPE&gt;&colon;&colon;value &amp;&amp;
                                                     !is&lowbar;pointer&lt;ALLOC&gt;&colon;&colon;value;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
