...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::future — Holds the result of an asynchronous computation.
// In header: <boost/compute/async/future.hpp> template<typename T> class future { public: // construct/copy/destruct future(); future(const T &, const event &); future(const future< T > &); future & operator=(const future< T > &); ~future(); // public member functions T get(); bool valid() const; void wait() const; event get_event() const; template<typename Function> future & then(Function); };
See Also:
event, wait_list
future
public member functionsT get();
Returns the result of the computation. This will block until the result is ready.
bool valid() const;Returns
true
if the future is valid. void wait() const;Blocks until the computation is complete.
event get_event() const;Returns the underlying event object.
template<typename Function> future & then(Function callback);
Invokes a generic callback function once the future is ready.
The function specified by callback must be invokable with zero arguments.
See the documentation for