Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case another method
[simgrid.git] / include / simgrid / kernel / future.hpp
index 581db40..f0c8cac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@ public:
   FutureStateBase(FutureStateBase const&) = delete;
   FutureStateBase& operator=(FutureStateBase const&) = delete;
 
-  XBT_PUBLIC(void) schedule(simgrid::xbt::Task<void()>&& job);
+  XBT_PUBLIC void schedule(simgrid::xbt::Task<void()>&& job);
 
   void set_exception(std::exception_ptr exception)
   {
@@ -181,7 +181,7 @@ public:
     xbt_assert(this->value_);
     T* result = value_;
     value_ = nullptr;
-    return *value_;
+    return *result;
   }
 
 private:
@@ -207,7 +207,7 @@ public:
 template<class T>
 void bindPromise(Promise<T> promise, Future<T> future)
 {
-  struct PromiseBinder {
+  class PromiseBinder {
   public:
     explicit PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
     void operator()(Future<T> future)
@@ -454,7 +454,7 @@ Future<T> unwrapFuture(Future<Future<T>> future)
 template<class T>
 class Promise {
 public:
-  explicit Promise() : state_(std::make_shared<FutureState<T>>()) {}
+  Promise() : state_(std::make_shared<FutureState<T>>()) {}
   explicit Promise(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
 
   // Move type
@@ -510,7 +510,7 @@ template<>
 class Promise<void> {
 public:
   Promise() : state_(std::make_shared<FutureState<void>>()) {}
-  Promise(std::shared_ptr<FutureState<void>> state) : state_(std::move(state)) {}
+  explicit Promise(std::shared_ptr<FutureState<void>> state) : state_(std::move(state)) {}
   ~Promise()
   {
     if (state_ && state_->get_status() == FutureStatus::not_ready)