diff --git a/src/blackmisc/metaclass.h b/src/blackmisc/metaclass.h index a2d86e0e0..49fea2413 100644 --- a/src/blackmisc/metaclass.h +++ b/src/blackmisc/metaclass.h @@ -100,22 +100,10 @@ namespace BlackMisc * \ingroup MetaClass */ template - struct MetaFlags /* : public std::integral_constant */ + struct MetaFlags : public std::integral_constant { //! Implicit conversion to std::false_type (if F is zero) or std::true_type (if F is non-zero). constexpr operator std::integral_constant(F)>() const { return {}; } - -#if defined(Q_CC_MSVC) && ! defined(Q_CC_CLANG) // gymnastics to workaround an MSVC 2017 precompiled header ICE - int m_dummy = 0; -#if _MSC_FULL_VER < 191000000 - constexpr MetaFlags() {} -#endif -#endif - constexpr operator quint64() const { return F; } //!< Implicit conversion to integer. - constexpr quint64 operator ()() const { return F; } //!< Call operator. - constexpr static quint64 value = F; //!< Value. - using value_type = quint64; //!< Value type. - using type = MetaFlags; //!< Own type. }; /*! diff --git a/src/blackmisc/typetraits.h b/src/blackmisc/typetraits.h index 444eb836d..4da4658eb 100644 --- a/src/blackmisc/typetraits.h +++ b/src/blackmisc/typetraits.h @@ -15,10 +15,6 @@ #include #include // for std::swap -#if defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && __GNUC__ >= 5) -#define BLACK_HAS_FIXED_CWG1558 -#endif - class QDBusArgument; namespace BlackMisc @@ -27,20 +23,10 @@ namespace BlackMisc class CPropertyIndex; //! \cond PRIVATE -#ifdef BLACK_HAS_FIXED_CWG1558 // Own implementation of C++17 std::void_t, simple variadic alias // template which is always void. Useful for expression SFINAE. template using void_t = void; -#else // Work around defect in the C++ standard - namespace Private - { - template - struct make_void { using type = void; }; - } - template - using void_t = typename Private::make_void::type; -#endif //! \endcond namespace Private @@ -77,21 +63,6 @@ namespace BlackMisc struct THasToQString().toQString())>> : public std::true_type {}; //! \endcond -#ifdef Q_CC_MSVC // work around what seems to be an expression SFINAE bug in MSVC - namespace Private - { - struct THasPushBackHelper - { - struct Base { int push_back; }; - template struct Derived : public T, public Base {}; - template struct TypeCheck {}; - template static std::false_type test(TypeCheck::push_back> *); - template static std::true_type test(...); - }; - } - template - using THasPushBack = decltype(Private::THasPushBackHelper::test(nullptr)); -#else /*! * Trait which is true if the expression a.push_back(v) is valid when a and v are instances of T and T::value_type. */ @@ -101,23 +72,7 @@ namespace BlackMisc template struct THasPushBack().push_back(std::declval()))>> : public std::true_type {}; //! \endcond -#endif -#ifdef Q_CC_MSVC - namespace Private - { - struct THasGetLogCategoriesHelper - { - struct Base { int getLogCategories; }; - template struct Derived : public T, public Base {}; - template struct TypeCheck {}; - template static std::false_type test(TypeCheck::getLogCategories> *); - template static std::true_type test(...); - }; - } - template - using THasGetLogCategories = decltype(Private::THasGetLogCategoriesHelper::test(nullptr)); -#else /*! * Trait to detect whether a class T has a static member function named getLogCategories. */ @@ -127,7 +82,6 @@ namespace BlackMisc template struct THasGetLogCategories> : public std::true_type {}; //! \endcond -#endif /*! * Trait to detect whether a class T can be used as a key in a QHash.