Skip to content

Commit 8d2b17e

Browse files
committed
Add another correction
1 parent a290b97 commit 8d2b17e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

_posts/2024-08-15-addendum.markdown

+23
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@ Listing 15.7 on page 175 of the printed version the lines 38 to 40 should be rem
1919
40 hpx::when_all(futures).get();
2020
{% endhighlight %}
2121

22+
## Apeendix
23+
24+
Listing A.10 is correct in source file, however, the pipes used for the ranges are not correctly rendered in the book.
25+
26+
27+
{% highlight c++ %}
28+
#include <cmath>
29+
#include <iostream>
30+
#include <ranges>
31+
#include <vector>
32+
33+
int main() {
34+
std ::vector<int> values = {0, 1, 2, 3, 4, 5, 6};
35+
36+
auto tr_values = values
37+
| std::views::filter([](int value) { return value % 2 == 0; })
38+
| std::views::transform([](int value) -> double { return std::sqrt(value);});
39+
for (int i : tr_values)
40+
std::cout << double(i) << ' ';
41+
std::cout << std::endl;
42+
}
43+
{% endhighlight %}
44+
2245

2346

2447

0 commit comments

Comments
 (0)