refs #213 Added precompiled header for MSVC in blackmisc, blackcore, blackgui.

This commit is contained in:
Mathew Sutcliffe
2017-02-17 18:14:27 +00:00
parent 01ccb4d023
commit e7f61dabea
10 changed files with 278 additions and 16 deletions

View File

@@ -78,10 +78,22 @@ namespace BlackMisc
* \ingroup MetaClass
*/
template <quint64 F>
struct MetaFlags : public std::integral_constant<quint64, F>
struct MetaFlags /* : public std::integral_constant<quint64, F> */
{
//! Implicit conversion to std::false_type (if F is zero) or std::true_type (if F is non-zero).
constexpr operator std::integral_constant<bool, static_cast<bool>(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.
};
/*!