[#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 `&lt;bslma&lowbar;managedptr&period;h&gt;`

Create and return a `ManagedPtr` to a new `ELEMENT&lowbar;TYPE` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class ELEMENT&lowbar;TYPE,
    class&period;&period;&period; ARGS&gt;
static
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;ELEMENT&lowbar;TYPE&gt;]
xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-0f.adoc[allocateManaged](
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator,
    ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-0f.adoc[_» more&period;&period;&period;_]#

Create and return a `ManagedPtr` using a class&hyphen;type `allocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class ELEMENT&lowbar;TYPE,
    class ALLOCATOR,
    class&period;&period;&period; ARGS&gt;
static
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;ELEMENT&lowbar;TYPE&gt;]
xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-06.adoc[allocateManaged](
    ALLOCATOR const& allocator,
    ARGS&&&period;&period;&period; args)
requires bsl&colon;&colon;is&lowbar;class&lt;ALLOCATOR&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslma/ManagedPtrUtil/allocateManaged-06.adoc[_» more&period;&period;&period;_]#

== Return Value

`ManagedPtr` managing the newly created `ELEMENT&lowbar;TYPE` object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocator*
| allocator used to supply memory for the new object
| *args*
| arguments forwarded to the `ELEMENT&lowbar;TYPE` constructor
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
