ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
future.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// Created by Eduard Valeyev on 7/10/18.
4//
5
6#ifndef TTG_FUTURE_H
7#define TTG_FUTURE_H
8
9#include <future>
10
11namespace ttg {
12
13template<typename T>
14bool has_value(std::future<T> const& f)
15{ return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; }
16
17template<typename T>
18bool has_value(std::shared_future<T> const& f)
19{ return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; }
20
21}
22
23#endif //TTG_FUTURE_H
top-level TTG namespace contains runtime-neutral functionality
Definition keymap.h:9
bool has_value(std::future< T > const &f)
Definition future.h:14