[#BloombergLP-bslma-AllocatorUtil-newObject-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::newObject
:relfileprefix: ../../../
:mrdocs:

`newObject` overloads

== Synopses

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

Return an object of (template parameter) `t&lowbar;TYPE` allocated from the specified `allocator` and constructed with no arguments except that, for scoped allocator types such as `bsl&colon;&colon;allocator` and `bsl&colon;&colon;polymorphic&lowbar;allocator`, `allocator` may be passed to the `t&lowbar;TYPE` constructor (i&period;e&period;, if `t&lowbar;TYPE` is AA)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;ALLOCATOR&gt;
static
AllocatorUtil&lowbar;Traits&lt;t&lowbar;ALLOCATOR, t&lowbar;TYPE&gt;::pointer
xref:BloombergLP/bslma/AllocatorUtil/newObject-09.adoc[newObject](t&lowbar;ALLOCATOR const& allocator);
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/newObject-09.adoc[_» more&period;&period;&period;_]#

Return an object of (template parameter) `t&lowbar;TYPE` allocated from the specified `allocator` and constructed from the specified `argument1` and other specified `arguments`&period; For scoped allocator types such as `bsl&colon;&colon;allocator` and `bsl&colon;&colon;polymorphic&lowbar;allocator`, `allocator` may be passed to the `t&lowbar;TYPE` constructor as an additional argument (i&period;e&period;, if `t&lowbar;TYPE` is AA)&period; Note that, in C&plus;&plus;03, perfect forwarding is limited such that any lvalue reference in the `arguments` parameter pack is const&hyphen;qualified when forwarded to the `TARGET&lowbar;TYPE` constructor&semi; only `argument1` can be forwarded as an unqualified lvalue&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;ALLOCATOR,
    class t&lowbar;ARG1,
    class&period;&period;&period; t&lowbar;ARGS&gt;
static
AllocatorUtil&lowbar;Traits&lt;t&lowbar;ALLOCATOR, t&lowbar;TYPE&gt;::pointer
xref:BloombergLP/bslma/AllocatorUtil/newObject-07.adoc[newObject](
    t&lowbar;ALLOCATOR const& allocator,
    t&lowbar;ARG1&& argument1,
    t&lowbar;ARGS&&&period;&period;&period; arguments);
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/newObject-07.adoc[_» more&period;&period;&period;_]#


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