The
task class template represents a sender that can
be used as the return type of coroutines
. The first template parameter
T defines the type of the value
completion datum (
[exec.async.ops]) if
T is not
void. Otherwise, there are no value completion datums
. Inside coroutines returning
task<T, E> the operand of
co_return (if any) becomes the argument of
set_value. The second template parameter
Environment is used to customize
the behavior of
task.