[#bsl-shared_ptr-0a-createInplace-04] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::createInplace :relfileprefix: ../../ :mrdocs: Create "in‐place" 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_TYPE` using the `ELEMENT_TYPE` constructor that takes the specified `args...` arguments, and make this shared pointer refer to the newly‐created `ELEMENT_TYPE` object. If an exception is thrown during the construction of the `ELEMENT_TYPE` object, this shared pointer will be unchanged. 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. Note that the allocator argument is _not_ implicitly passed to the constructor for `ELEMENT_TYPE`; to construct an object of `ELEMENT_TYPE` with an allocator, pass the allocator as one of the arguments (typically the last argument), or assign with a `shared_ptr` created using the standard `allocate_shared` function. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... ARGS> void createInplace( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, ARGS&&... args); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#