X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387..edada81d50549499871369f63a5ac01d652b283e:/include/simgrid/kernel/future.hpp diff --git a/include/simgrid/kernel/future.hpp b/include/simgrid/kernel/future.hpp index b41008eb64..b0be4b1e71 100644 --- a/include/simgrid/kernel/future.hpp +++ b/include/simgrid/kernel/future.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2020. The SimGrid Team. +/* Copyright (c) 2016-2021. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -329,7 +329,7 @@ public: */ template auto then_no_unwrap(F continuation) -> Future { - typedef decltype(continuation(std::move(*this))) R; + using R = decltype(continuation(std::move(*this))); if (state_ == nullptr) throw std::future_error(std::future_errc::no_state); auto state = std::move(state_); @@ -358,19 +358,16 @@ public: * @exception std::future_error no state is associated with the future */ template - auto then(F continuation) -> typename std::enable_if::value, - Future>::type + auto then(F continuation) -> typename std::enable_if_t::value, + Future> { return this->then_no_unwrap(std::move(continuation)); } /** Attach a continuation to this future (future chaining) */ - template - auto then(F continuation) - -> typename std::enable_if< - is_future::value, - decltype(continuation(std::move(*this))) - >::type + template + auto then(F continuation) -> typename std::enable_if_t::value, + decltype(continuation(std::move(*this)))> { return unwrap_future(this->then_no_unwrap(std::move(continuation))); }