[#BloombergLP-bslma-ManagedPtrUtil-allocateManaged-0e] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtrUtil.adoc[ManagedPtrUtil]::allocateManaged :relfileprefix: ../../../ :mrdocs: `allocateManaged` overloads == Synopses Declared in `<bslma_managedptr.h>` Create an object of the (template parameter) `ELEMENT_TYPE` from the specified `args...` arguments, and return a `ManagedPtr` to manage the new object. Use the specified `allocator` to supply memory for the footprint of the new object and implicitly pass `allocator` as the allocator argument to the `ELEMENT_TYPE` constructor if `bslma::UsesBslmaAllocator<ELEMENT_TYPE>::value` is `true`. If `allocator` is a null pointer, the currently installed default allocator is used. Note that compilation will fail unless `allocator` is convertible to either `bslma::Allocator *` or `bsl::allocator<>`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ELEMENT_TYPE, class... ARGS> static xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr<ELEMENT_TYPE>] xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-0f.adoc[allocateManaged]( xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator, ARGS&&... args); ---- [.small]#xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-0f.adoc[_» more..._]# Same as the overload taking `bslma::Allocator *`, but accepts a class‐type `allocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ELEMENT_TYPE, class ALLOCATOR, class... ARGS> static xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr<ELEMENT_TYPE>] xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-06.adoc[allocateManaged]( ALLOCATOR const& allocator, ARGS&&... args) requires bsl::is_class<ALLOCATOR>::value; ---- [.small]#xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-06.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#