#include <iostream>
#include <atomic>
#define Q_DECL_NOTHROW noexcept
#define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
template <typename T> struct QAtomicOps
{
typedef std::atomic<T> Type;
};
template <typename T>
class QBasicAtomicInteger
{
public:
typedef QAtomicOps<T> Ops;
typename Ops::Type _q_value;
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
QBasicAtomicInteger() = default;
constexpr QBasicAtomicInteger(T value) Q_DECL_NOTHROW : _q_value(value) {}
QBasicAtomicInteger(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) volatile = delete;
#endif
};
typedef QBasicAtomicInteger<int> QBasicAtomicInt;
#ifndef Q_BASIC_ATOMIC_INITIALIZER
# define Q_BASIC_ATOMIC_INITIALIZER(a) { (a) }
#endif
struct QMetaTypeIdQObject
{
enum {
Defined = 1
};
static int qt_metatype_id()
{
static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0);
return metatype_id._q_value;
}
};
int main()
{
std::cout << QMetaTypeIdQObject::qt_metatype_id() << std::endl;
return 0;
}