diff --git a/src/blackmisc/optional.h b/src/blackmisc/optional.h index 982f28656..a2d5f2e53 100644 --- a/src/blackmisc/optional.h +++ b/src/blackmisc/optional.h @@ -100,7 +100,7 @@ namespace BlackMisc #else T &dereference() { Q_ASSERT(m_isValid); return *reinterpret_cast(m_bytes); } const T &dereference() const { Q_ASSERT(m_isValid); return *reinterpret_cast(m_bytes); } - char m_bytes[sizeof(T)]; + typename std::aligned_storage::type m_bytes[1]; #endif };