| Home | Libraries | People | FAQ | More

## Class template future

boost::compute::future — Holds the result of an asynchronous computation.

## Synopsis

    // In header: <boost/compute/async/future.hpp>

    template<typename T>
    class future {
    public:

      // public member functions
      future();
      future(const T &, const event &);
      future(const future< T > &);
      future & operator=(const future< T > &);
      ~future();
      T get();
      bool valid() const;
      void wait() const;
      event get_event() const;
      template<typename Function> future & then(Function);
    };

## Description

See Also: event, wait_list

### `future` public member functions

1.     future();

2.     future(const T & result, const event & event);

3.     future(const future< T > & other);

4.     future & operator=(const future< T > & other);

5.     ~future();

6.     T get();

   Returns the result of the computation. This will block until the result is ready.

7.     bool valid() const;

   Returns `true` if the future is valid.

8.     void wait() const;

   Blocks until the computation is complete.

9.     event get_event() const;

   Returns the underlying event object.

10.     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