-/* 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
#include <xbt/base.h>
#include <xbt/functional.hpp>
-#include <xbt/future.hpp>
+#include <xbt/promise.hpp>
namespace simgrid {
namespace kernel {
* @exception std::future_error no state is associated with the future
*/
template <class F>
- auto then(F continuation) -> typename std::enable_if<not is_future<decltype(continuation(std::move(*this)))>::value,
- Future<decltype(continuation(std::move(*this)))>>::type
+ auto then(F continuation) -> typename std::enable_if_t<not is_future<decltype(continuation(std::move(*this)))>::value,
+ Future<decltype(continuation(std::move(*this)))>>
{
return this->then_no_unwrap(std::move(continuation));
}
/** Attach a continuation to this future (future chaining) */
- template<class F>
- auto then(F continuation)
- -> typename std::enable_if<
- is_future<decltype(continuation(std::move(*this)))>::value,
- decltype(continuation(std::move(*this)))
- >::type
+ template <class F>
+ auto then(F continuation) -> typename std::enable_if_t<is_future<decltype(continuation(std::move(*this)))>::value,
+ decltype(continuation(std::move(*this)))>
{
return unwrap_future(this->then_no_unwrap(std::move(continuation)));
}