mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
Resolving issue #662
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# <a name="main"></a>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.
|
||||
|
||||
### <a name="Res-range-checking"></a>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`.
|
||||
|
||||
Reference in New Issue
Block a user