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>
template<class... ARGS>
void
createInplace(
BloombergLP::bslma::Allocator* basicAllocator,
ARGS&&... args);
Created with MrDocs