You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed the two anchors back (anchors need to stay stable and don't
display visibly anyway)
Switched "non-public" back to hyphernated (to use hyphenation
consistently)
Copy file name to clipboardExpand all lines: CppCoreGuidelines.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4000,7 +4000,7 @@ Class rule summary:
4000
4000
* [C.4: Make a function a member only if it needs direct access to the representation of a class](#Rc-member)
4001
4001
* [C.5: Place helper functions in the same namespace as the class they support](#Rc-helper)
4002
4002
* [C.7: Don't define a class or enum and declare a variable of its type in the same statement](#Rc-standalone)
4003
-
* [C.8: Use `class` rather than `struct` if any member is nonpublic](#Rc-class)
4003
+
* [C.8: Use `class` rather than `struct` if any member is non-public](#Rc-class)
4004
4004
* [C.9: Minimize exposure of members](#Rc-private)
4005
4005
4006
4006
Subsections:
@@ -4234,7 +4234,7 @@ Mixing a type definition and the definition of another entity in the same declar
4234
4234
4235
4235
* Flag if the `}` of a class or enumeration definition is not followed by a `;`. The `;` is missing.
4236
4236
4237
-
### <a name="Rc-class"></a>C.8: Use `class` rather than `struct` if any member is nonpublic
4237
+
### <a name="Rc-class"></a>C.8: Use `class` rather than `struct` if any member is non-public
4238
4238
4239
4239
##### Reason
4240
4240
@@ -6896,7 +6896,7 @@ not using this (over)general interface in favor of a particular interface found
6896
6896
##### Enforcement
6897
6897
6898
6898
* Look for classes with lots of members that do nothing but throw.
6899
-
* Flag every use of a nonpublic base class `B` where the derived class `D` does not override a virtual function or access a protected member in `B`, and `B` is not one of the following: empty, a template parameter or parameter pack of `D`, a class template specialized with `D`.
6899
+
* Flag every use of a non-public base class `B` where the derived class `D` does not override a virtual function or access a protected member in `B`, and `B` is not one of the following: empty, a template parameter or parameter pack of `D`, a class template specialized with `D`.
6900
6900
6901
6901
### <a name="Rh-abstract"></a>C.121: If a base class is used as an interface, make it a pure abstract class
6902
6902
@@ -9952,7 +9952,7 @@ Arithmetic rules:
9952
9952
* [ES.103: Don't overflow](#Res-overflow)
9953
9953
* [ES.104: Don't underflow](#Res-underflow)
9954
9954
* [ES.105: Don't divide by zero](#Res-zero)
9955
-
* [ES.106: Don't try to avoid negative values by using `unsigned`](#Res-non-negative)
9955
+
* [ES.106: Don't try to avoid negative values by using `unsigned`](#Res-nonnegative)
9956
9956
* [ES.107: Don't use `unsigned` for subscripts, prefer `gsl::index`](#Res-subscripts)
9957
9957
9958
9958
### <a name="Res-lib"></a>ES.1: Prefer the standard library to other libraries and to "handcrafted code"
@@ -13276,7 +13276,7 @@ This also applies to `%`.
13276
13276
* Flag division by an integral value that could be zero
13277
13277
13278
13278
13279
-
### <a name="Res-non-negative"></a>ES.106: Don't try to avoid negative values by using `unsigned`
13279
+
### <a name="Res-nonnegative"></a>ES.106: Don't try to avoid negative values by using `unsigned`
* [T.60: Minimize a template's context dependencies](#Rt-depend)
16558
16558
* [T.61: Do not over-parameterize members (SCARY)](#Rt-scary)
16559
-
* [T.62: Place non-dependent class template members in a non-templated base class](#Rt-non-dependent)
16559
+
* [T.62: Place non-dependent class template members in a non-templated base class](#Rt-nondependent)
16560
16560
* [T.64: Use specialization to provide alternative implementations of class templates](#Rt-specialization)
16561
16561
* [T.65: Use tag dispatch to provide alternative implementations of functions](#Rt-tag-dispatch)
16562
16562
* [T.67: Use specialization to provide alternative implementations for irregular types](#Rt-specialization2)
@@ -17823,7 +17823,7 @@ Some people found the idea that the `Link` no longer was hidden inside the list
17823
17823
* Flag member types that do not depend on every template argument
17824
17824
* Flag member functions that do not depend on every template argument
17825
17825
17826
-
### <a name="Rt-non-dependent"></a>T.62: Place non-dependent class template members in a non-templated base class
17826
+
### <a name="Rt-nondependent"></a>T.62: Place non-dependent class template members in a non-templated base class
17827
17827
17828
17828
##### Reason
17829
17829
@@ -21994,7 +21994,7 @@ In many cases, holding properly encapsulated resources using RAII "owning" objec
21994
21994
21995
21995
Prefer compiler-generated (including `=default`) special members; only these can be classified as "trivial", and at least one major standard library vendor heavily optimizes for classes having trivial special members. This is likely to become common practice.
21996
21996
21997
-
**Exceptions**: When any of the special functions are declared only to make them nonpublic or virtual, but without special semantics, it doesn't imply that the others are needed.
21997
+
**Exceptions**: When any of the special functions are declared only to make them non-public or virtual, but without special semantics, it doesn't imply that the others are needed.
21998
21998
In rare cases, classes that have members of strange types (such as reference members) are an exception because they have peculiar copy semantics.
21999
21999
In a class holding a reference, you likely need to write the copy constructor and the assignment operator, but the default destructor already does the right thing. (Note that using a reference member is almost always wrong.)
0 commit comments