From 4ad63d7d34717fe7581310ee73f49591cc44d75c Mon Sep 17 00:00:00 2001 From: Timm Knape Date: Thu, 12 Oct 2023 21:41:49 +0200 Subject: [PATCH] F.21 add loop increment in bad example (#2141) to mimic the previous examples and avoid an infinite loop. --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 16e2e30..8198821 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3301,7 +3301,7 @@ To compare, if we passed out all values as return values, we would something lik return {in, move(s)}; } - for (auto p = get_string(cin); p.first; ) { + for (auto p = get_string(cin); p.first; p.second = get_string(p.first).second) { // do something with p.second }