From b94ea19e51e836adec7bc0fdbc7a47a1f346cbc5 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Fri, 16 Jun 2017 15:45:45 -0700 Subject: [PATCH] fix util::optional copy/move constructors --- src/util/optional.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.30.2