ccia_code_samples icon indicating copy to clipboard operation
ccia_code_samples copied to clipboard

Listing 9.3 - Compile Error

Open ITHelpDec opened this issue 1 year ago • 0 comments

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.

ITHelpDec avatar Jul 28 '23 07:07 ITHelpDec