+/** Call a functional object with the values in the given tuple (from C++17)
+ *
+ * @code{.cpp}
+ * int foo(int a, bool b);
+ *
+ * auto args = std::make_tuple(1, false);
+ * int res = apply(foo, args);
+ * @encode
+ **/
+template <class F, class Tuple>
+constexpr auto apply(F&& f, Tuple&& t)
+ -> decltype(simgrid::xbt::bits::apply(
+ std::forward<F>(f),
+ std::forward<Tuple>(t),
+ simgrid::xbt::make_index_sequence<
+ std::tuple_size<typename std::decay<Tuple>::type>::value
+ >()))
+{
+ return simgrid::xbt::bits::apply(
+ std::forward<F>(f),
+ std::forward<Tuple>(t),
+ simgrid::xbt::make_index_sequence<
+ std::tuple_size<typename std::decay<Tuple>::type>::value
+ >());
+}
+
+template<class T> class Task;
+
+namespace bits {
+
+ // Something similar exist in C++14:
+ template<class T>
+ constexpr T max(T a, T b)