[#BloombergLP-bslma-ManagedPtrUtil-makeManaged]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtrUtil.adoc[ManagedPtrUtil]::makeManaged
:relfileprefix: ../../../
:mrdocs:

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

== Synopsis

Declared in `&lt;bslma&lowbar;managedptr&period;h&gt;`

[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;]
makeManaged(ARGS&&&period;&period;&period; args);
----

== Description

Create an object of the (template parameter) `ELEMENT&lowbar;TYPE` from the specified `args&period;&period;&period;` arguments, and return a `ManagedPtr` to manage the new object&period; Use the currently installed default allocator to supply memory for the footprint of the new object but do _not_ implicitly pass the default allocator as the allocator argument to its constructor even if `bslma&colon;&colon;UsesBslmaAllocator&lt;ELEMENT&lowbar;TYPE&gt;&colon;&colon;value` is `true`&period; Note that an allocator may be included in `args`, but see `allocateManaged` for an alternative function that is better suited to creating managed pointers to objects of allocator&hyphen;aware type&period;

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *args*
| arguments forwarded to the `ELEMENT&lowbar;TYPE` constructor
|===


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