[#absl-NoDestructor-08-2constructor-04a] = xref:absl.adoc[absl]::xref:absl/NoDestructor-08.adoc[NoDestructor]::NoDestructor :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<absl/base/no_destructor.h>` Deleted: `NoDestructor` is not copyable. [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..._]# Forwards copy construction for T. Enables usage like this: static NoDestructor<std::array<string, 3>> x{{{"1", "2", "3"}}}; static NoDestructor<std::vector<int>> x{{1, 2, 3}}; [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..._]# Forwards move construction for T. [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..._]# Forwards arguments to the T's constructor: calls T(args...). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename... Ts> requires !std::is_same_v<void(std::decay_t<Ts>&...), void(NoDestructor&)> constexpr explicit xref:absl/NoDestructor-08/2constructor-02.adoc[NoDestructor](Ts&&... args); ---- [.small]#xref:absl/NoDestructor-08/2constructor-02.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *x* | The value to copy‐construct the wrapped `T` from. | *args* | The arguments forwarded to `T`'s constructor. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#