[#bsl-shared_ptr-0a-createInplace-00] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::createInplace :relfileprefix: ../../ :mrdocs: `createInplace` overloads == Synopses Declared in `<bslstl_sharedptr.h>` Create "in‐place" in a large enough contiguous memory region both an internal representation for this shared pointer and a default‐constructed object of `ELEMENT_TYPE`, and make this shared pointer refer to the newly‐created `ELEMENT_TYPE` object. The currently installed default allocator is used to supply memory. If an exception is thrown during allocation or 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/shared_ptr-0a/createInplace-07.adoc[createInplace](); ---- [.small]#xref:bsl/shared_ptr-0a/createInplace-07.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... ARGS> void xref:bsl/shared_ptr-0a/createInplace-04.adoc[createInplace]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, ARGS&&... args); ---- [.small]#xref:bsl/shared_ptr-0a/createInplace-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#