#
#include <taskflow/core/taskflow.hpp>
template<typename T>
tf::Future class

class to access the result of an execution

tf::Future is a derived class from std::future that will eventually hold the execution result of a submitted taskflow (tf::Executor::run) In addition to the base methods inherited from std::future, you can call tf::Future::cancel to cancel the execution of the running taskflow associated with this future object. The following example cancels a submission of a taskflow that contains 1000 tasks each running one second.

    tf::Executor executor;
    tf::Taskflow taskflow;

    for(int i=0; i<1000; i++) {
      taskflow.emplace([](){
        std::this_thread::sleep_for(std::chrono::seconds(1));
      });
    }

    // submit the taskflow
    tf::Future fu = executor.run(taskflow);

    // request to cancel the submitted execution above
    fu.cancel();

    // wait until the cancellation finishes
    fu.get();

## Constructors, destructors, conversion operators

Future() defaulted
  default constructor
Future(const Future&) deleted
  disabled copy constructor
Future( Future&&) defaulted
  default move constructor

## Public functions

auto operator=(const Future&) -> Future& deleted
  disabled copy assignment
auto operator=( Future&&) -> Future& defaulted
  default move assignment
auto cancel() -> bool
  cancels the execution of the running taskflow associated with this future object

## Function documentation

###
template<typename T>
bool tf::Future<T>:: cancel()

cancels the execution of the running taskflow associated with this future object

Returns | `true` if the execution can be cancelled or `false` if the execution has already completed

When you request a cancellation, the executor will stop scheduling any tasks onwards. Tasks that are already running will continue to finish (non-preemptive). You can call tf::Future::wait to wait for the cancellation to complete.

Tab / T to search, Esc to close
…

Search for symbols, directories, files, pages or modules. You can omit any prefix from the symbol or file path; adding a `:` or `/` suffix lists all members of given symbol or directory.

Use ↓ / ↑ to navigate through the list, Enter to go. Tab autocompletes common prefix, you can copy a link to the result using ⌘ L while ⌘ M produces a Markdown link.

Sorry, nothing was found.