diff options
Diffstat (limited to 'src/corelib/global/qflags.h')
-rw-r--r-- | src/corelib/global/qflags.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index b871c90c9d..89a0ae9083 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -42,13 +42,12 @@ #ifndef QFLAGS_H #define QFLAGS_H -#include <QtCore/qtypeinfo.h> -#include <QtCore/qtypetraits.h> - #ifdef Q_COMPILER_INITIALIZER_LISTS #include <initializer_list> #endif +#include <type_traits> + QT_BEGIN_NAMESPACE class QFlag @@ -94,6 +93,8 @@ class QFlags Q_STATIC_ASSERT_X((sizeof(Enum) <= sizeof(int)), "QFlags uses an int as storage, so an enum with underlying " "long long will overflow."); + Q_STATIC_ASSERT_X((std::is_enum<Enum>::value), "QFlags is only usable on enumeration types."); + struct Private; typedef int (Private::*Zero); public: @@ -103,7 +104,7 @@ public: typedef int Int; #else typedef typename std::conditional< - QtPrivate::QIsUnsignedEnum<Enum>::value, + std::is_unsigned<typename std::underlying_type<Enum>::type>::value, unsigned int, signed int >::type Int; |