From 617c1216750ad6da957088a4c8f9092dc508a463 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 15 Apr 2016 10:41:57 -1000 Subject: [PATCH] GCC compatibility fixes --- include/optional.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/optional.hpp b/include/optional.hpp index 6bc51df..2955d04 100644 --- a/include/optional.hpp +++ b/include/optional.hpp @@ -554,11 +554,15 @@ public: } constexpr T const& value() const { - return initialized() ? contained_val() : atFatal("bad optional access"); + if (!initialized()) + atFatal("bad optional access"); + return contained_val(); } T& value() { - return initialized() ? contained_val() : atFatal("bad optional access"); + if (!initialized()) + atFatal("bad optional access"); + return contained_val(); } # endif