refs #504 Fixed MSVC2013 compiler error regression.

This commit is contained in:
Mathew Sutcliffe
2015-11-05 16:16:33 +00:00
parent 3f8020d6e5
commit 15b8363e30

View File

@@ -101,9 +101,9 @@ namespace BlackMisc
};
Data m_data;
#else
T &dereference() { Q_ASSERT(m_isValid); return *reinterpret_cast<T *>(m_bytes); }
const T &dereference() const { Q_ASSERT(m_isValid); return *reinterpret_cast<const T *>(m_bytes); }
typename std::aligned_storage<sizeof(T)>::type m_bytes[1];
T &dereference() { Q_ASSERT(m_isValid); return *reinterpret_cast<T *>(m_data.bytes); }
const T &dereference() const { Q_ASSERT(m_isValid); return *reinterpret_cast<const T *>(m_data.bytes); }
struct { typename std::aligned_storage<sizeof(T)>::type bytes[1]; } m_data;
#endif
};