[#absl-NoDestructor-08-2constructor-04a]
= xref:absl.adoc[absl]::xref:absl/NoDestructor-08.adoc[NoDestructor]::NoDestructor
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;absl&sol;base&sol;no&lowbar;destructor&period;h&gt;`

Deleted&colon; `NoDestructor` is not copyable&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/NoDestructor-08/2constructor-01.adoc[NoDestructor](xref:absl/NoDestructor-08.adoc[NoDestructor] const& other) = delete;
----

[.small]#xref:absl/NoDestructor-08/2constructor-01.adoc[_» more&period;&period;&period;_]#

Forwards copy construction for T&period; Enables usage like this&colon; static NoDestructor&lt;std&colon;&colon;array&lt;string, 3&gt;&gt; x&lcub;&lcub;&lcub;&quot;1&quot;, &quot;2&quot;, &quot;3&quot;&rcub;&rcub;&rcub;&semi; static NoDestructor&lt;std&colon;&colon;vector&lt;int&gt;&gt; x&lcub;&lcub;1, 2, 3&rcub;&rcub;&semi;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
xref:absl/NoDestructor-08/2constructor-04e.adoc[NoDestructor](T const& x);
----

[.small]#xref:absl/NoDestructor-08/2constructor-04e.adoc[_» more&period;&period;&period;_]#

Forwards move construction for T&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
xref:absl/NoDestructor-08/2constructor-03.adoc[NoDestructor](T&& x);
----

[.small]#xref:absl/NoDestructor-08/2constructor-03.adoc[_» more&period;&period;&period;_]#

Forwards arguments to the T&apos;s constructor&colon; calls T(args&period;&period;&period;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename&period;&period;&period; Ts&gt;
requires !std&colon;&colon;is&lowbar;same&lowbar;v&lt;void(std&colon;&colon;decay&lowbar;t&lt;Ts&gt;&amp;&period;&period;&period;),
                                             void(NoDestructor&amp;)&gt;
constexpr
explicit
xref:absl/NoDestructor-08/2constructor-02.adoc[NoDestructor](Ts&&&period;&period;&period; args);
----

[.small]#xref:absl/NoDestructor-08/2constructor-02.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| The value to copy&hyphen;construct the wrapped `T` from&period;
| *args*
| The arguments forwarded to `T`&apos;s constructor&period;
|===


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