mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Clarify ES.48 enforcement rule for void cast of [[nodiscard]] (#1588)
This commit is contained in:
parent
1ca5545ce1
commit
040b141acf
|
@ -11707,7 +11707,7 @@ Casts are widely (mis) used. Modern C++ has rules and constructs that eliminate
|
|||
|
||||
##### Enforcement
|
||||
|
||||
* Force the elimination of C-style casts, except on a function with a `[[nodiscard]]` return.
|
||||
* Force the elimination of C-style casts, except when casting a `[[nodiscard]]` function return value to void.
|
||||
* Warn if there are many functional style casts (there is an obvious problem in quantifying 'many').
|
||||
* The [type profile](#Pro-type-reinterpretcast) bans `reinterpret_cast`.
|
||||
* Warn against [identity casts](#Pro-type-identitycast) between pointer types, where the source and target types are the same (#Pro-type-identitycast).
|
||||
|
|
Loading…
Reference in New Issue
Block a user