diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-07-10 19:05:21 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-07-10 19:05:21 +0100 |
| commit | a15d816ea8504844f5a429d687370e90b369cff5 (patch) | |
| tree | 228eab118b832bffd01eebd501348543c19b95e3 /src/optional.hh | |
| parent | 1d1927647ada77e897b1763810ba6f068b0a6705 (diff) | |
Use a named struct Empty in optional
Diffstat (limited to 'src/optional.hh')
| -rw-r--r-- | src/optional.hh | 3 |
1 files changed, 2 insertions, 1 deletions
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; |
