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

Create &quot;in&hyphen;place&quot; in a large enough contiguous memory region, using the specified `basicAllocator` to supply memory, both an internal representation for this shared pointer and an object of `ELEMENT&lowbar;TYPE` using the `ELEMENT&lowbar;TYPE` constructor that takes the specified `args&period;&period;&period;` arguments, and make this shared pointer refer to the newly&hyphen;created `ELEMENT&lowbar;TYPE` object&period; If an exception is thrown during the 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; Note that the allocator argument is _not_ implicitly passed to the constructor for `ELEMENT&lowbar;TYPE`&semi; to construct an object of `ELEMENT&lowbar;TYPE` with an allocator, pass the allocator as one of the arguments (typically the last argument), or assign with a `shared&lowbar;ptr` created using the standard `allocate&lowbar;shared` function&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; ARGS&gt;
void
createInplace(
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    ARGS&&&period;&period;&period; args);
----


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