From a15d816ea8504844f5a429d687370e90b369cff5 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 10 Jul 2015 19:05:21 +0100 Subject: [PATCH] Use a named struct Empty in optional --- src/optional.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;