From bd948ee83973b81f4c79c59c99b56759daed2169 Mon Sep 17 00:00:00 2001 From: Mitch Phillips <31459023+hctim@users.noreply.github.com> Date: Fri, 22 Dec 2017 13:01:42 -0800 Subject: [PATCH] Fix example code in F.20. (#1109) --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 5ec4ef4..73e4afa 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2997,9 +2997,9 @@ Such older advice is now obsolete; it does not add value, and it interferes with vector g(const vector& vx) { // ... - f() = vx; // prevented by the "const" + fct() = vx; // prevented by the "const" // ... - return f(); // expensive copy: move semantics suppressed by the "const" + return fct(); // expensive copy: move semantics suppressed by the "const" } The argument for adding `const` to a return value is that it prevents (very rare) accidental access to a temporary.