June 2017
Intermediate to advanced
532 pages
12h 59m
English
We are going to implement a program that does multiple different things concurrently but instead of explicitly starting threads, we use std::async and std::future:
#include <iostream> #include <iomanip> #include <map> #include <string> #include <algorithm> #include <iterator> #include <future> using namespace std;
static map<char, size_t> histogram(const string &s) { map<char, size_t> m; for (char c : s) { m[c] += 1; } return m;Read now
Unlock full access