string flip(string s) {
reverse(s.begin(), s.end());
return s;
}
int main() {
vector<future<string>> v;
v.push_back(async([] { return flip( " ,olleH"); }));
v.push_back(async([] { return flip(" egdelwonK"); }));
v.push_back(async([] { return flip("\n!rebmahC"); }));
for (auto& e : v) {
cout << e.get();
}
}
Concurrency, futures and lambda functions... Moved objects, automatic type deductions and new for loop syntax...A whole new language, isn't it?
No comments:
Post a Comment