absl::NoDestructor::NoDestructor

Constructors

Synopses

Declared in <absl/base/no_destructor.h>

Deleted: NoDestructor is not copyable.

NoDestructor(NoDestructor const& other) = delete;
» 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}};

constexpr
explicit
NoDestructor(T const& x);
» more...

Forwards move construction for T.

constexpr
explicit
NoDestructor(T&& x);
» more...

Forwards arguments to the T's constructor: calls T(args...).

template<typename... Ts>
requires !std::is_same_v<void(std::decay_t<Ts>&...),
                                             void(NoDestructor&)>
constexpr
explicit
NoDestructor(Ts&&... args);
» more...

Parameters

NameDescription
xThe value to copy-construct the wrapped T from.
argsThe arguments forwarded to T's constructor.