From 7fe5ef9649f6ee997f3ef91ded13535449db0b2b Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Mon, 16 Oct 2023 09:35:53 +0200 Subject: [PATCH] Add a const to a range-based for loop. --- talk/basicconcepts/control.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talk/basicconcepts/control.tex b/talk/basicconcepts/control.tex index 7e83b449..42e7e43a 100644 --- a/talk/basicconcepts/control.tex +++ b/talk/basicconcepts/control.tex @@ -240,7 +240,7 @@ \end{alertblock} \begin{exampleblock}{\cpp20} \begin{cppcode*}{firstnumber=6} - for (std::size_t i = 0; auto& d : data) { + for (std::size_t i = 0; auto const & d : data) { std::cout << i++ << ' ' << d << '\n'; } \end{cppcode*}