This is an automated email from the ASF dual-hosted git repository.

mzhu pushed a commit to branch 1.6.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 424fd997b85d71bea202dddf81a813dfbdf651b9
Author: Benjamin Bannier <[email protected]>
AuthorDate: Thu Oct 18 09:33:35 2018 +0200

    Relaxed `Promise` constructor and assignment operator requirements.
    
    This patch enables construction and assignment from rvalues for
    `Promise` values.
    
    Review: https://reviews.apache.org/r/69041/
---
 3rdparty/libprocess/include/process/future.hpp | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/3rdparty/libprocess/include/process/future.hpp 
b/3rdparty/libprocess/include/process/future.hpp
index fb107d2..369007b 100644
--- a/3rdparty/libprocess/include/process/future.hpp
+++ b/3rdparty/libprocess/include/process/future.hpp
@@ -704,7 +704,12 @@ public:
   explicit Promise(const T& t);
   virtual ~Promise();
 
-  Promise(Promise<T>&& that);
+  // Not copyable, not assignable.
+  Promise(const Promise& that) = delete;
+  Promise(Promise&& that) = default;
+  Promise& operator=(const Promise&) = delete;
+  Promise& operator=(Promise&&) = default;
+
 
   bool discard();
   bool set(const T& _t);
@@ -725,10 +730,6 @@ private:
   template <typename U>
   bool _set(U&& u);
 
-  // Not copyable, not assignable.
-  Promise(const Promise<T>&);
-  Promise<T>& operator=(const Promise<T>&);
-
   // Helper for doing the work of actually discarding a future (called
   // from Promise::discard as well as internal::discarded).
   static bool discard(Future<T> future);
@@ -802,11 +803,6 @@ Promise<T>::~Promise()
 
 
 template <typename T>
-Promise<T>::Promise(Promise<T>&& that)
-  : f(std::move(that.f)) {}
-
-
-template <typename T>
 bool Promise<T>::discard()
 {
   if (!f.data->associated) {

Reply via email to