simple thread
Public Member Functions | Static Public Member Functions | List of all members
st::task Struct Reference

wrap any Callable and optional arguments into an executable task More...

#include <task.hpp>

Inheritance diagram for st::task:
st::shared_context< task, detail::task::context >

Public Member Functions

dataoperator() ()
 

Static Public Member Functions

template<typename... As>
static task make (As &&... as)
 wrap an arbitrary Callable and optional arguments in a task More...
 

Detailed Description

wrap any Callable and optional arguments into an executable task

A Callable is any data or object which can be executed like a function:

st:task accepts no arguments and returns void. It is useful for generically encapsulating operatins which should occur elsewhere.

st::task objects when invoked will return a reference to an st::data value when invoked containing the returned value of the wrapped Callable. If wrapped Callable returns void, the resulting st::data& will be empty and == false when used in an if statement.

st::task objects are 'lazy', when they have been evaluated once further evaluations will immediately return the previously returned value with no further work.

Member Function Documentation

◆ make()

template<typename... As>
static task st::task::make ( As &&...  as)
inlinestatic

wrap an arbitrary Callable and optional arguments in a task

Parameters
asany Callable followed by optional arguments

The documentation for this struct was generated from the following file: