[#bsl-shared_ptr-0a-createInplace-07]
= xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]::createInplace
:relfileprefix: ../../
:mrdocs:

Create the managed object in&hyphen;place using the default allocator&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
createInplace();
----

== Description

Create &quot;in&hyphen;place&quot; in a large enough contiguous memory region both an internal representation for this shared pointer and a default&hyphen;constructed object of `ELEMENT&lowbar;TYPE`, and make this shared pointer refer to the newly&hyphen;created `ELEMENT&lowbar;TYPE` object&period; The currently installed default allocator is used to supply memory&period; If an exception is thrown during allocation or construction of the `ELEMENT&lowbar;TYPE` object, this shared pointer will be unchanged&period; Otherwise, if this shared pointer is already managing a (possibly shared) object, then release the shared reference to that shared object, and destroy it using its associated deleter if this shared pointer held the last shared reference to that object&period;


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