diff --git a/src/optional.hh b/src/optional.hh index cdc7d100..3aa3676f 100644 --- a/src/optional.hh +++ b/src/optional.hh @@ -80,9 +80,10 @@ public: private: void destruct_ifn() { if (m_valid) m_value.~T(); } + struct Empty {}; union { - struct {} m_empty; // disable default construction of value + Empty m_empty; // disable default construction of value T m_value; }; bool m_valid;