January 2018
Intermediate to advanced
374 pages
9h 53m
English
When the sparse range is created, it is merged sequentially using the resulting value from each std::future, as illustrated in the following figure. This is performed sequentially as the parts overlap. Note that std::move is used instead of copying to avoid unnecessary copying:

// ...continued from above...
// Part #2: Perform merge of resulting sparse range sequentially auto new_end = futures.front().get().second; for(auto it = std::next(futures.begin()); it != futures.end(); ++it) { auto chunk_rng = it->get(); new_end=std::move(chunk_rng.first, ...