Skip to content

Commit c7650b8

Browse files
committed
Update Listing 3.6
1 parent 3df9567 commit c7650b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

_posts/2024-08-15-addendum.markdown

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ if (values.size() % 2 == 0) {
2222
}
2323
{% endhighlight %}
2424

25+
[Listing 3.6](https://github.com/ModernCPPBook/Examples/blob/main/notebooks/Chapter_3.ipynb) the [C++20 range-based for statements with initializer](https://en.cppreference.com/w/cpp/language/range-for)
26+
27+
{% highlight c++ %}
28+
for (int index = 0; const int value : values) {
29+
std::cout << "Index=" << index++ << " Value= " << value
30+
}
31+
{% endhighlight %}
32+
2533
## Chapter 15
2634

2735
[Listing 15.7](https://github.com/ModernCPPBook/Examples/blob/main/cpp/Chapter_15/Listing_15_7.cpp) on page 175 of the printed version the lines 38 to 40 should be removed.

0 commit comments

Comments
 (0)