From 6ed82c8b7bc7b59e147852df73e1d0c4f15de648 Mon Sep 17 00:00:00 2001 From: bgloyer <36457894+bgloyer@users.noreply.github.com> Date: Thu, 4 Nov 2021 11:56:35 -0700 Subject: [PATCH] ES.11 Issue #1763 (#1849) * Update for Issue 1763 * add copy case * Add 'DataRecord' --- CppCoreGuidelines.md | 5 ++++- scripts/hunspell/isocpp.dic | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 7d12c18..9f3e967 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -10449,7 +10449,10 @@ Flag variable and constant declarations with multiple declarators (e.g., `int* p Consider: - auto p = v.begin(); // vector::iterator + auto p = v.begin(); // vector::iterator + auto z1 = v[3]; // makes copy of DataRecord + auto& z2 = v[3]; // avoids copy + const auto& z3 = v[3]; // const and avoids copy auto h = t.future(); auto q = make_unique(s); auto f = [](int x) { return x + 10; }; diff --git a/scripts/hunspell/isocpp.dic b/scripts/hunspell/isocpp.dic index 9f9858e..68ab1d3 100644 --- a/scripts/hunspell/isocpp.dic +++ b/scripts/hunspell/isocpp.dic @@ -140,6 +140,7 @@ d2 D2 d2's dag +DataRecord dcl dd de