From: Jacob Lifshay Date: Thu, 20 Jul 2017 08:11:03 +0000 (-0700) Subject: fixed bug in util::optional::reset(); forgot to set is_full to false X-Git-Tag: gsoc-2017~65 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=609ded941bc974e802fac577341c3eb5a231b7f7;p=kazan.git fixed bug in util::optional::reset(); forgot to set is_full to false --- diff --git a/src/util/optional.h b/src/util/optional.h index 99b748d..c11ba78 100644 --- a/src/util/optional.h +++ b/src/util/optional.h @@ -80,6 +80,7 @@ struct Optional_base { if(is_full) full_value.~T(); + is_full = false; } template T &emplace(Types &&... args) noexcept(std::is_nothrow_constructible::value) @@ -179,6 +180,7 @@ struct Optional_base void reset() noexcept { // full_value.~T() not needed + is_full = false; } template T &emplace(Types &&... args) noexcept(std::is_nothrow_constructible::value) @@ -275,6 +277,7 @@ struct Optional_base void reset() noexcept { // full_value.~T() not needed + is_full = false; } template T &emplace(Types &&... args) noexcept(std::is_nothrow_constructible::value)