The code below is based on Herb Sutter\'s ideas of an implementation of a .then() type continuation.
template auto then(F
Here is the solution, tested with g++ 4.8 and clang++ 3.2:
template auto then(F&& f, W w) -> std::future { cout<<"In thread id = "< result=std::async([]{ return 12;}); auto f = then(std::move(result), [](int r) { cout<<"[after] thread id = "<