mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 04:44:34 +03:00
Remove whitespace at the end of lines
This commit is contained in:
committed by
Jonathan Wakely
parent
1e4dba2c0b
commit
2cedd99f32
@@ -8484,7 +8484,7 @@ Convenience of use and avoidance of errors.
|
||||
{
|
||||
return d = (d == Day::sun) ? Day::mon : static_cast<Day>(static_cast<int>(d)+1);
|
||||
}
|
||||
|
||||
|
||||
Day today = Day::sat;
|
||||
Day tomorrow = ++today;
|
||||
|
||||
@@ -11247,7 +11247,7 @@ Surprised? I'm just glad I didn't crash the program.
|
||||
|
||||
##### Note
|
||||
|
||||
Programmers who write casts typically assume that they know what they are doing,
|
||||
Programmers who write casts typically assume that they know what they are doing,
|
||||
or that writing a cast makes the program "easier to read".
|
||||
In fact, they often disable the general rules for using values.
|
||||
Overload resolution and template instantiation usually pick the right function if there is a right function to pick.
|
||||
@@ -12550,7 +12550,7 @@ It has been noted that
|
||||
|
||||
is a common beginners error.
|
||||
If you use C-style strings, you must know the `<cstring>` functions well.
|
||||
Being verbose and writing
|
||||
Being verbose and writing
|
||||
|
||||
if(strcmp(p1, p2) != 0) { ... } // are the two C-style strings equal? (mistake!)
|
||||
|
||||
@@ -19932,9 +19932,9 @@ An implementation of this profile shall recognize the following patterns in sour
|
||||
|
||||
Type safety profile summary:
|
||||
|
||||
* <a name="Pro-type-avoidcasts"></a>Type.1: [Avoid casts](#Res-casts):
|
||||
<a name="Pro-type-reinterpretcast">a. </a>Don't use `reinterpret_cast`; A strict version of [Avoid casts](#Res-casts) and [prefer named casts](#Res-casts-named).
|
||||
<a name="Pro-type-arithmeticcast">b. </a>Don't use `static_cast` for arithmetic types; A strict version of [Avoid casts](#Res-casts) and [prefer named casts](#Res-casts-named).
|
||||
* <a name="Pro-type-avoidcasts"></a>Type.1: [Avoid casts](#Res-casts):
|
||||
<a name="Pro-type-reinterpretcast">a. </a>Don't use `reinterpret_cast`; A strict version of [Avoid casts](#Res-casts) and [prefer named casts](#Res-casts-named).
|
||||
<a name="Pro-type-arithmeticcast">b. </a>Don't use `static_cast` for arithmetic types; A strict version of [Avoid casts](#Res-casts) and [prefer named casts](#Res-casts-named).
|
||||
<a name="Pro-type-identitycast">c. </a>Don't cast between pointer types where the source type and the target type are the same; A strict version of [Avoid casts](#Res-casts).
|
||||
<a name="Pro-type-implicitpointercast">d. </a>Don't cast between pointer types when the conversion could be implicit; A strict version of [Avoid casts](#Res-casts).
|
||||
* <a name="Pro-type-downcast"></a>Type.2: Don't use `static_cast` to downcast:
|
||||
@@ -21498,7 +21498,7 @@ Clang-tidy has a set of rules that specifically enforce the C++ Core Guidelines.
|
||||
|
||||
### <a name="St-cppcorecheck"></a>Tools: [CppCoreCheck](https://docs.microsoft.com/en-us/visualstudio/code-quality/using-the-cpp-core-guidelines-checkers)
|
||||
|
||||
The Microsoft compiler's C++ code analysis contains a set of rules specifically aimed at enforcement of the C++ Core Guidelines.
|
||||
The Microsoft compiler's C++ code analysis contains a set of rules specifically aimed at enforcement of the C++ Core Guidelines.
|
||||
|
||||
# <a name="S-glossary"></a>Glossary
|
||||
|
||||
|
||||
Reference in New Issue
Block a user