fix operator = bug in util::optional
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 16 Jun 2017 22:22:05 +0000 (15:22 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 16 Jun 2017 22:22:05 +0000 (15:22 -0700)
src/util/optional.h

index 714470746ce0e5ffce70c96e2208b49115924e37..3186719ec3a3f637cea6c83ed1b4cfc7fee147ef 100644 (file)
@@ -399,7 +399,6 @@ private:
 
 public:
     using Base::Base;
-    using Base::operator=;
     using Base::reset;
     using Base::emplace;
     constexpr optional() noexcept = default;
@@ -469,6 +468,8 @@ public:
         : Base(in_place, std::forward<U>(value))
     {
     }
+    optional &operator=(const optional &) = default;
+    optional &operator=(optional &&) = default;
     template <typename U = T,
               typename = typename std::
                   enable_if<!std::is_same<typename std::decay<U>::type, optional>::value