I'm excited. For the first time it is now possible to do futures in 7 lines of code:
T delegate() future(T)(lazy T expr)
{
T res;
auto t = new Thread({res = expr();});
t.start;
return { t.wait; return res; }
}
Which could then be used as follows:
auto hard_result = future( hard_expression );
// Do stuff ...
use_result(hard_result());