This is an automated email from the ASF dual-hosted git repository. bbannier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 341593dd3fd242310e7f48975d22607d706bfc76 Author: Benjamin Bannier <benjamin.bann...@mesosphere.io> 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 ba21201..deea369 100644 --- a/3rdparty/libprocess/include/process/future.hpp +++ b/3rdparty/libprocess/include/process/future.hpp @@ -707,7 +707,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); @@ -728,10 +733,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); @@ -805,11 +806,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) {