7#include <QtCore/qatomic.h>
8#include <QtCore/qtclasshelpermacros.h>
25 using Type =
typename QGS::QGS_Type;
43 std::atomic_thread_fence(std::memory_order_acquire);
52 Q_DISABLE_COPY_MOVE(
Holder)
58 using Type =
typename Holder::Type;
77 "The global static was used after being destroyed");
83 "The global static was used after being destroyed");
91 return holder.pointer();
99#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
101 QT_WARNING_DISABLE_CLANG("-Wunevaluated-expression") \
102 namespace { struct Q_QGS_ ## NAME { \
103 typedef TYPE QGS_Type; \
104 static void innerFunction(void *pointer) \
105 noexcept(noexcept(std::remove_cv_t<QGS_Type> ARGS)) \
107 new (pointer) QGS_Type ARGS; \
110 Q_CONSTINIT static QGlobalStatic<QtGlobalStatic::Holder<Q_QGS_ ## NAME>> NAME; \
114#define Q_GLOBAL_STATIC(TYPE, NAME, ...) \
115 Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, (__VA_ARGS__))
void storeRelaxed(T newValue) noexcept
Combined button and popup list for selecting options.
#define Q_ASSERT_X(cond, x, msg)
static Type * instance() noexcept(Holder::ConstructionIsNoexcept)
static QtGlobalStatic::GuardValues guardValue() noexcept
bool exists() const noexcept
bool isDestroyed() const noexcept
PlainType * pointer() noexcept
static constexpr bool ConstructionIsNoexcept
Holder() noexcept(ConstructionIsNoexcept)
static Q_CONSTINIT QBasicAtomicInteger< qint8 > guard
std::remove_cv_t< Type > PlainType