A plain serial version of this program without any async and future magic would look like the following:
int main(){ string result { concat( twice( concat( create("foo "), create("bar "))), concat( create("this "), create("that "))) }; cout << result << '\n';}
In this recipe, we wrote the helper functions async_adapter and asynchronize that helped us create new functions from create, concat, and twice. We called those new asynchronous functions pcreate, pconcat, and ptwice.
Let us first ignore the complexity of the implementation of async_adapter and asynchronize, in order to first have a look what this got us.
The serial version looks similar to this code:
string result {concat( ... )};cout << result << '\n';
The parallelized ...