mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Resolving issue #662
This commit is contained in:
parent
fbeff91d05
commit
5b1043104c
|
@ -1,6 +1,6 @@
|
||||||
# <a name="main"></a>C++ Core Guidelines
|
# <a name="main"></a>C++ Core Guidelines
|
||||||
|
|
||||||
April 2, 2017
|
April 3, 2017
|
||||||
|
|
||||||
|
|
||||||
Editors:
|
Editors:
|
||||||
|
@ -10890,7 +10890,7 @@ In any variant, we must guard against data races on the `cache` in multithreaded
|
||||||
|
|
||||||
##### Enforcement
|
##### 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
|
### <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.
|
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
|
##### 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`.
|
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`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user