Functional-styled future in c++