26 #ifndef SRC_TILEDARRAY_META_H_ 27 #define SRC_TILEDARRAY_META_H_ 29 #include <madness/world/world.h> 30 #include <madness/world/future.h> 31 #include <madness/world/world_task_queue.h> 38 template <
bool head,
bool... tail>
45 static constexpr
bool value = b;
51 template <
typename Function,
typename... Args>
52 auto invoke(Function&& fn, Args&&... args) ->
typename std::enable_if<
54 decltype(fn(args...))>::type {
55 return fn(std::forward<Args>(args)...);
58 template <
typename Function,
typename... Args,
59 typename =
typename std::enable_if<or_reduce<
false,
60 madness::is_future<std::decay_t<Args>>::value...>::value>::type>
61 auto invoke(Function&& fn, Args&&... args) {
62 return TiledArray::get_default_world().taskq.add(fn, std::forward<Args>(args)...);
68 #endif // SRC_TILEDARRAY_META_H_