From: Jacob Lifshay Date: Fri, 16 Jun 2017 22:45:45 +0000 (-0700) Subject: fix util::optional copy/move constructors X-Git-Tag: gsoc-2017~94 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b94ea19e51e836adec7bc0fdbc7a47a1f346cbc5;p=kazan.git fix util::optional copy/move constructors --- diff --git a/src/util/optional.h b/src/util/optional.h index 3186719..99b748d 100644 --- a/src/util/optional.h +++ b/src/util/optional.h @@ -402,6 +402,10 @@ public: using Base::reset; using Base::emplace; constexpr optional() noexcept = default; + constexpr optional(const optional &) noexcept(std::is_nothrow_copy_constructible::value) = + default; + constexpr optional(optional &&) noexcept(std::is_nothrow_move_constructible::value) = + default; template () @@ -468,8 +472,10 @@ public: : Base(in_place, std::forward(value)) { } - optional &operator=(const optional &) = default; - optional &operator=(optional &&) = default; + constexpr optional &operator=(const optional &) noexcept( + std::is_nothrow_copy_assignable::value) = default; + constexpr optional &operator=(optional &&) noexcept(std::is_nothrow_move_assignable::value) = + default; template ::type, optional>::value