From ff5e5735b1a0c68e759787fa5f5844eab8b12c5d Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sun, 14 Jun 2015 19:51:39 +0100 Subject: [PATCH] Corrected alignment of COptional::m_bytes. --- src/blackmisc/optional.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 };