[#bsl-allocate_shared_for_overwrite-01c]
= xref:bsl.adoc[bsl]::allocate&lowbar;shared&lowbar;for&lowbar;overwrite
:relfileprefix: ../
:mrdocs:

Return a `shared&lowbar;ptr` object referring to and managing a new `ELEMENT&lowbar;TYPE` object&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 `ELEMENT&lowbar;TYPE` object, which is default&hyphen;constructed&period; If `basicAllocator` is 0, then the default allocator will be used instead&period;

== Synopsis

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

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


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