ccia_code_samples
ccia_code_samples copied to clipboard
Listing 9.3 - Compile Error
A return
is needed when calling the two-parameter version of accumulate_block()
inside of the lambda function.
futures[i] = pool.submit([=] () {
- accumulate_block<_ForwardIt, _Tp>()(block_start, block_end);
+ return accumulate_block<_ForwardIt, _Tp>()(block_start, block_end);
});
Without it, we receive the following error:
No viable overloaded '='
The listing in this repo (here) also doesn't mirror what was written in the book, so I've first brought them in sync before applying the correction.