mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix / Consistent Enforcement sections
This commit is contained in:
parent
c83bdc5495
commit
b2a4132cf2
|
@ -5957,7 +5957,7 @@ Don't leave it undeclared.
|
||||||
|
|
||||||
This will leak the object used to initialize `p1` (only).
|
This will leak the object used to initialize `p1` (only).
|
||||||
|
|
||||||
**Enforcement:** (Simple) Warn if the return value of `new` or a function call with return value of pointer type is assigned to a raw pointer.
|
**Enforcement**: (Simple) Warn if the return value of `new` or a function call with return value of pointer type is assigned to a raw pointer.
|
||||||
|
|
||||||
|
|
||||||
<a name="Rr-unique"></a>
|
<a name="Rr-unique"></a>
|
||||||
|
@ -8983,10 +8983,9 @@ See [Stable base](#Rt-abi).
|
||||||
**Note**: In a class template, nonvirtual functions are only instantiated if they're used -- but virtual functions are instantiated every time. This can bloat code size, and may overconstrain a generic type by instantiating functionality that is never needed. Avoid this, even though the standard facets made this mistake.
|
**Note**: In a class template, nonvirtual functions are only instantiated if they're used -- but virtual functions are instantiated every time. This can bloat code size, and may overconstrain a generic type by instantiating functionality that is never needed. Avoid this, even though the standard facets made this mistake.
|
||||||
|
|
||||||
**Enforcement**:
|
**Enforcement**:
|
||||||
|
|
||||||
* Flag a class template that declares new (non-inherited) virtual functions.
|
* Flag a class template that declares new (non-inherited) virtual functions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="SS-concepts"></a>
|
<a name="SS-concepts"></a>
|
||||||
## TPG.concepts: Concept rules
|
## TPG.concepts: Concept rules
|
||||||
|
|
||||||
|
@ -9761,8 +9760,8 @@ There are three major ways to let calling code customize a template.
|
||||||
}
|
}
|
||||||
|
|
||||||
**Enforcement**:
|
**Enforcement**:
|
||||||
* In a template, flag an unqualified call to a nonmember function that passes a variable of dependent type when there is a nonmember function of the same name in the template's namespace.
|
|
||||||
|
|
||||||
|
* In a template, flag an unqualified call to a nonmember function that passes a variable of dependent type when there is a nonmember function of the same name in the template's namespace.
|
||||||
|
|
||||||
<a name="SS-temp-hier"></a>
|
<a name="SS-temp-hier"></a>
|
||||||
## T.temp-hier: Template and hierarchy rules:
|
## T.temp-hier: Template and hierarchy rules:
|
||||||
|
@ -10237,12 +10236,9 @@ Of course, range-for is better still where it does what you want.
|
||||||
**Exceptions**: If you do have a valid reason to specialize a function template, just write a single function template that delegates to a class template, then specialize the class template (including the ability to write partial specializations).
|
**Exceptions**: If you do have a valid reason to specialize a function template, just write a single function template that delegates to a class template, then specialize the class template (including the ability to write partial specializations).
|
||||||
|
|
||||||
**Enforcement**:
|
**Enforcement**:
|
||||||
|
|
||||||
* Flag all specializations of a function template. Overload instead.
|
* Flag all specializations of a function template. Overload instead.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="S-cpl"></a>
|
<a name="S-cpl"></a>
|
||||||
# CPL: C-style programming
|
# CPL: C-style programming
|
||||||
|
|
||||||
|
@ -10557,8 +10553,8 @@ Complicates conversion to use language-supported modules (when they become avail
|
||||||
// file3.h:
|
// file3.h:
|
||||||
#include "file1.h"
|
#include "file1.h"
|
||||||
|
|
||||||
**Enforcement: Flag all cycles.
|
|
||||||
|
|
||||||
|
**Enforcement**: Flag all cycles.
|
||||||
|
|
||||||
<a name="Rs-namespace"></a>
|
<a name="Rs-namespace"></a>
|
||||||
### SF.20: Use `namespace`s to express logical structure
|
### SF.20: Use `namespace`s to express logical structure
|
||||||
|
|
Loading…
Reference in New Issue
Block a user