Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Return what was apparently intended.
[simgrid.git] / include / simgrid / kernel / future.hpp
index 581db40..766d425 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -181,7 +181,7 @@ public:
     xbt_assert(this->value_);
     T* result = value_;
     value_ = nullptr;
-    return *value_;
+    return *result;
   }
 
 private:
@@ -209,7 +209,7 @@ void bindPromise(Promise<T> promise, Future<T> future)
 {
   struct PromiseBinder {
   public:
-    explicit PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
+    PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
     void operator()(Future<T> future)
     {
       simgrid::xbt::setPromise(promise_, future);
@@ -282,7 +282,7 @@ template<class T>
 class Future {
 public:
   Future() = default;
-  explicit Future(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
+  Future(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
 
   // Move type:
   Future(Future&) = delete;
@@ -454,8 +454,8 @@ Future<T> unwrapFuture(Future<Future<T>> future)
 template<class T>
 class Promise {
 public:
-  explicit Promise() : state_(std::make_shared<FutureState<T>>()) {}
-  explicit Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
+  Promise() : state_(std::make_shared<FutureState<T>>()) {}
+  Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
 
   // Move type
   Promise(Promise const&) = delete;