2
When the body is an expression or contains a single return statement, the return type is the result of the expression or return statement expression:
• x = active { foo(10) }; // call foo asynchronously
y = active { a->b( c ) }; // evaluate asynchronously
p = active { new T }; // allocate and construct asynchronously
• … // more code, runs concurrently with all three active lambdas
• // there is no waiting until we explicitly say “wait” to use results
return x.wait() * y.wait() * p.wait()->bar();
•Writing “active { … }” is syntactic sugar for
writing “active auto ( /* all auto params */ ) { … }”.
Active Lambda Expressions/Functions