7#ifndef SkNoDestructor_DEFINED
8#define SkNoDestructor_DEFINED
86 static_assert(!(std::is_trivially_constructible_v<T> && std::is_trivially_destructible_v<T>),
87 "T is trivially constructible and destructible; please use a constinit object of "
88 "type T directly instead");
90 static_assert(!std::is_trivially_destructible_v<T>,
91 "T is trivially destructible; please use a function-local static of type T "
96 new (fStorage)
T(std::forward<Args>(
args)...);
115 const T*
get()
const {
return reinterpret_cast<const T*
>(fStorage); }
116 T*
get() {
return reinterpret_cast<T*
>(fStorage); }
119 alignas(
T) std::byte fStorage[
sizeof(
T)];
121#if defined(__clang__) && defined(__has_feature)
122#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
132 T* fStoragePtr =
reinterpret_cast<T*
>(fStorage);
SkNoDestructor(const SkNoDestructor &)=delete
~SkNoDestructor()=default
SkNoDestructor(const T &x)
const T * operator->() const
SkNoDestructor(Args &&... args)
const T & operator*() const
SkNoDestructor & operator=(const SkNoDestructor &)=delete
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args