From 5b1043104c83550f7c6cfb6f920963080853b5c2 Mon Sep 17 00:00:00 2001 From: Andrew Pardoe Date: Mon, 3 Apr 2017 12:07:43 -0700 Subject: [PATCH] Resolving issue #662 --- CppCoreGuidelines.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index fa4343d..a7abf69 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1,6 +1,6 @@ # C++ Core Guidelines -April 2, 2017 +April 3, 2017 Editors: @@ -10890,7 +10890,7 @@ In any variant, we must guard against data races on the `cache` in multithreaded ##### Enforcement -Flag `const_cast`s. +Flag `const_cast`s. See also [Type.3: Don't use `const_cast` to cast away `const` (i.e., at all)](#Pro-type-constcast) for the related Profile. ### ES.55: Avoid the need for range checking @@ -17608,6 +17608,8 @@ Instead, prefer to put the common code in a common helper function -- and make i You may need to cast away `const` when calling `const`-incorrect functions. Prefer to wrap such functions in inline `const`-correct wrappers to encapsulate the cast in one place. +##### See also: [ES.50, Don't cast away `const`](#Res-casts-const) for more discussion. + ##### Enforcement Issue a diagnostic for any use of `const_cast`. To fix: Either don't use the variable in a non-`const` way, or don't make it `const`.