[#BloombergLP-bslma-ManagedPtrUtil-allocateManaged-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtrUtil.adoc[ManagedPtrUtil]::allocateManaged :relfileprefix: ../../../ :mrdocs: Create and return a `ManagedPtr` using a class‐type `allocator`. == Synopsis Declared in `<bslma_managedptr.h>` [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>] allocateManaged( ALLOCATOR const& allocator, ARGS&&... args) requires bsl::is_class<ALLOCATOR>::value; ---- == Description Same as the overload taking `bslma::Allocator *`, but accepts a class‐type `allocator`. == Return Value `ManagedPtr` managing the newly created `ELEMENT_TYPE` object == Parameters [cols="1,4"] |=== | Name| Description | *allocator* | class‐type allocator used to supply memory | *args* | arguments forwarded to the `ELEMENT_TYPE` constructor |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#