Modify CFamily rules: CPP-4080 Refresh and standardize CppCoreGuidelines references (#3514)
Update all links to C++ Core Guidelines to `e49158a`.
Refresh done using the following script and some manual edits:
db76e34e74/personal/fred-tingaud/rspec/refresh-cppcoreguidelines.py
When re-using this script, be mindful that:
- it does not cover `shared_content`
- it does not properly escape inline code in links (e.g., "[=]" or "`mutex`es")
- it does not change `C++` to `{cpp}` in link titles.
Co-authored-by: Marco Borgeaud <marco.borgeaud@sonarsource.com>
This commit is contained in:
parent
6610704c1c
commit
22b4470f2a
@ -46,7 +46,7 @@ When web pages have massively long names like "Java™ Platform, Standard Editio
|
||||
* Azure Documentation - https://learn.microsoft.com/en-us/azure/?product=popular
|
||||
* CERT - https://wiki.sei.cmu.edu/confluence/display/seccode
|
||||
* {cpp} reference - https://en.cppreference.com/w/
|
||||
* C++ Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md
|
||||
* CVE - https://cve.mitre.org
|
||||
* CWE - https://cwe.mitre.org
|
||||
* Docker Documentation - https://docs.docker.com/
|
||||
|
@ -58,7 +58,7 @@ The issue only happens if the using directive is at global scope or at namespace
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp}:2008, 7-3-6 - using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files.
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#sf7-dont-write-using-namespace-at-global-scope-in-a-header-file[{cpp} Core Guidelines SF.7] - Don’t write ``++using namespace++`` at global scope in a header file
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#sf7-dont-write-using-namespace-at-global-scope-in-a-header-file[SF.7: Don't write `using namespace` at global scope in a header file]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -44,7 +44,7 @@ bool isMax(T t){
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp}:2008, 14-8-1
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#t144-dont-specialize-function-templates[{cpp} Core Guidelines T.144] - Don’t specialize function templates
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t144-dont-specialize-function-templates[T.144: Don't specialize function templates]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -47,7 +47,7 @@ try {
|
||||
* CERT - https://wiki.sei.cmu.edu/confluence/x/SXs-BQ[ERR61-CPP. Catch exceptions by lvalue reference]
|
||||
|
||||
=== External coding guidelines
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#e15-catch-exceptions-from-a-hierarchy-by-reference[E.15 Catch exceptions from a hierarchy by reference]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#e15-throw-by-value-catch-exceptions-from-a-hierarchy-by-reference[E.15: Throw by value, catch exceptions from a hierarchy by reference]
|
||||
* MISRA {cpp}:2008, 15-3-5 - A class type exception shall always be caught by reference
|
||||
|
||||
=== Related rules
|
||||
|
@ -4,7 +4,7 @@ include::../rule.adoc[]
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#i23-keep-the-number-of-function-arguments-low[{cpp} Core Guidelines I.23]: Keep the number of function arguments low
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#i23-keep-the-number-of-function-arguments-low[I.23: Keep the number of function arguments low]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -103,7 +103,7 @@ void checkState(S state) {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Re-exception-types[E.14: Use purpose-designed user-defined types as exceptions (not built-in types)]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#e14-use-purpose-designed-user-defined-types-as-exceptions-not-built-in-types[E.14: Use purpose-designed user-defined types as exceptions (not built-in types)]
|
||||
|
||||
|
||||
=== Related rules
|
||||
|
@ -28,7 +28,7 @@ void fun(const std::vector<int> &myVector) {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#reason-382[T.143 - Don't write unintentionally nongeneric code]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t143-dont-write-unintentionally-non-generic-code[T.143: Don't write unintentionally non-generic code]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -44,7 +44,7 @@ void doSomething(int a) {
|
||||
* MISRA {cpp}:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
|
||||
* MISRA C:2012, 2.7 - There should be no unused parameters in functions
|
||||
* https://wiki.sei.cmu.edu/confluence/x/5dUxBQ[CERT, MSC12-C.] - Detect and remove code that has no effect or is never executed
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f9-unused-parameters-should-be-unnamed[{cpp} Core Guidelines - F.9] - Unused parameters should be unnamed
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f9-unused-parameters-should-be-unnamed[F.9: Unused parameters should be unnamed]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -41,7 +41,7 @@ Additionally, if the ``++catch++`` handler is throwing an exception (either the
|
||||
== Resources
|
||||
|
||||
* https://cwe.mitre.org/data/definitions/396[MITRE, CWE-396] - Declaration of Catch for Generic Exception
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Re-exception-types[{cpp} Core Guidelines E.14] - Use purpose-designed user-defined types as exceptions (not built-in types)
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#e14-use-purpose-designed-user-defined-types-as-exceptions-not-built-in-types[E.14: Use purpose-designed user-defined types as exceptions (not built-in types)]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -27,7 +27,7 @@ auto p2 = std::make_unique<Person>("Bjarne"); // Compliant
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r10-avoid-malloc-and-free[{cpp} Core Guidelines R.10] - Avoid malloc() and free()
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r10-avoid-malloc-and-free[R.10: Avoid `malloc()` and `free()`]
|
||||
|
||||
|
||||
|
||||
|
@ -42,6 +42,6 @@ public:
|
||||
|
||||
* https://wiki.sei.cmu.edu/confluence/x/5Xs-BQ[CERT, OOP52-CPP.] - Do not delete a polymorphic object without a virtual destructor
|
||||
* http://www.gotw.ca/publications/mill18.htm[Virtuality article]
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-nonvirtual[{cpp} Core Guidelines C.35] - A base class destructor should be either public and virtual, or protected and nonvirtual
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c127-a-class-with-a-virtual-function-should-have-a-virtual-or-protected-destructor[{cpp} Core Guidelines C.127] - A class with a virtual function should have a virtual or protected destructor
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual[C.35: A base class destructor should be either public and virtual, or protected and non-virtual]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c127-a-class-with-a-virtual-function-should-have-a-virtual-or-protected-destructor[C.127: A class with a virtual function should have a virtual or protected destructor]
|
||||
|
||||
|
@ -38,6 +38,6 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c60-make-copy-assignment-non-virtual-take-the-parameter-by-const-and-return-by-non-const[{cpp} Core Guidelines C.60] - Make copy assignment non-virtual, take the parameter by const&, and return by non-const&
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c63-make-move-assignment-non-virtual-take-the-parameter-by\--and-return-by-non-const-[{cpp} Core Guidelines C.63] - Make move assignment non-virtual, take the parameter by &&, and return by non-const &
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c60-make-copy-assignment-non-virtual-take-the-parameter-by-const-and-return-by-non-const[C.60: Make copy assignment non-`virtual`, take the parameter by `const&`, and return by non-`const&`]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c63-make-move-assignment-non-virtual-take-the-parameter-by--and-return-by-non-const[C.63: Make move assignment non-`virtual`, take the parameter by `&&`, and return by non-`const&`]
|
||||
|
||||
|
@ -46,7 +46,7 @@ because passing arguments by reference to a coroutine often leads to dangling re
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const[{cpp} Core Guidelines F.16] - For “in” parameters, pass cheaply-copied types by value and others by reference to ``++const++``
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const[F.16: For "in" parameters, pass cheaply-copied types by value and others by reference to `const`]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -59,7 +59,7 @@ void stopServer(Base *obj) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c138-create-an-overload-set-for-a-derived-class-and-its-bases-with-using[{cpp} Core Guidelines C.138] - Create an overload set for a derived class and its bases with using
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c138-create-an-overload-set-for-a-derived-class-and-its-bases-with-using[C.138: Create an overload set for a derived class and its bases with `using`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -101,7 +101,7 @@ void f() {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r15-always-overload-matched-allocationdeallocation-pairs[R.15: Always overload matched allocation/deallocation pairs]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r15-always-overload-matched-allocationdeallocation-pairs[R.15: Always overload matched allocation/deallocation pairs]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -29,5 +29,5 @@ int fun() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Rl-void[{cpp} Core Guidelines NL.25] - Don't use void as an argument type
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#nl25-dont-use-void-as-an-argument-type[NL.25: Don't use `void` as an argument type]
|
||||
|
||||
|
@ -34,7 +34,7 @@ int &j3 = i2;
|
||||
|
||||
* MISRA {cpp}:2008, 8-0-1 - An init-declarator-list or a member-declarator-list shall consist of a single init-declarator or member-declarator respectively
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es10-declare-one-name-only-per-declaration[{cpp} Core Guidelines - ES.10] - Declare one name (only) per declaration
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es10-declare-one-name-only-per-declaration[ES.10: Declare one name (only) per declaration]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -122,6 +122,6 @@ class Child : public Parent {
|
||||
== Resources
|
||||
|
||||
* https://wiki.sei.cmu.edu/confluence/x/6ns-BQ[CERT, OOP50-CPP.] - Do not invoke virtual functions from constructors or destructors
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-factory[{cpp} Core Guidelines C.50] - Use a factory function if you need “virtual behavior” during initialization
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c50-use-a-factory-function-if-you-need-virtual-behavior-during-initialization[C.50: Use a factory function if you need "virtual behavior" during initialization]
|
||||
|
||||
include::../rspecator.adoc[]
|
@ -70,8 +70,8 @@ Additionally, developers can use `explicit(false)` to mark constructors or conve
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp}:2008, 12-1-3 - All constructors that are callable with a single argument of fundamental type shall be declared ``++explicit++``.
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c46-by-default-declare-single-argument-constructors-explicit[{cpp} Core Guidelines C.46] - By default, declare single-argument constructors explicit
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c164-avoid-implicit-conversion-operators[{cpp} Core Guidelines C.164] - Avoid implicit conversion operators
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c46-by-default-declare-single-argument-constructors-explicit[C.46: By default, declare single-argument constructors explicit]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c164-avoid-implicit-conversion-operators[C.164: Avoid implicit conversion operators]
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ signed long int i;
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Rl-const[{cpp} Core Guidelines NL.26] - Use conventional ``++const++`` notation
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#nl26-use-conventional-const-notation[NL.26: Use conventional `const` notation]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -270,7 +270,7 @@ struct ContainerPartial {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c41-a-constructor-should-create-a-fully-initialized-object[C.41: A constructor should create a fully initialized object]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c41-a-constructor-should-create-a-fully-initialized-object[C.41: A constructor should create a fully initialized object]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -54,7 +54,7 @@ public void doSomething(int i) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es70-prefer-a-switch-statement-to-an-if-statement-when-there-is-a-choice[{cpp} Core Guidelines ES.70]: Prefer a switch-statement to an if-statement when there is a choice
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es70-prefer-a-switch-statement-to-an-if-statement-when-there-is-a-choice[ES.70: Prefer a `switch`-statement to an `if`-statement when there is a choice]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -119,8 +119,8 @@ include::../../../shared_content/cfamily/reference_over_nonnull_pointer.adoc[]
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md[F.16: For "in" parameters, pass cheaply-copied types by value and others by reference to const]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md[F.17: For "in-out" parameters, pass by reference to non-const]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const[F.16: For "in" parameters, pass cheaply-copied types by value and others by reference to `const`]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f17-for-in-out-parameters-pass-by-reference-to-non-const[F.17: For "in-out" parameters, pass by reference to non-`const`]
|
||||
|
||||
|
||||
=== Related rules
|
||||
|
@ -28,7 +28,7 @@ If a derived class overrides a function with a dynamic exception specification,
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#e30-dont-use-exception-specifications[{cpp} Core Guidelines E.30] - Don’t use exception specifications
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#e30-dont-use-exception-specifications[E.30: Don't use exception specifications]
|
||||
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ class Raspberry : public RedFruit { // RedFruit inherits from Fruit privately
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es12-do-not-reuse-names-in-nested-scopes[{cpp} Core Guidelines - ES.12] - Do not reuse names in nested scopes
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es12-do-not-reuse-names-in-nested-scopes[ES.12: Do not reuse names in nested scopes]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -177,8 +177,8 @@ include::../standards.adoc[]
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md[F.16: For "in" parameters, pass cheaply-copied types by value and others by reference to const]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md[F.17: For "in-out" parameters, pass by reference to non-const]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f16-for-in-parameters-pass-cheaply-copied-types-by-value-and-others-by-reference-to-const[F.16: For "in" parameters, pass cheaply-copied types by value and others by reference to `const`]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f17-for-in-out-parameters-pass-by-reference-to-non-const[F.17: For "in-out" parameters, pass by reference to non-`const`]
|
||||
|
||||
|
||||
=== Related rules
|
||||
|
@ -27,7 +27,7 @@ friend bool operator==(const MyClass &LHS, const MyClass &RHS);
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c161-use-nonmember-functions-for-symmetric-operators[{cpp} Core Guidelines C.161] - Use nonmember functions for symmetric operators
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c161-use-non-member-functions-for-symmetric-operators[C.161: Use non-member functions for symmetric operators]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -75,7 +75,7 @@ int main() {
|
||||
== Resources
|
||||
|
||||
* https://wiki.sei.cmu.edu/confluence/x/dXw-BQ[CERT, OOP53-CPP.] - Write constructor member initializers in the canonical order
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c47-define-and-initialize-member-variables-in-the-order-of-member-declaration[{cpp} Core Guidelines C.47] - Define and initialize member variables in the order of member declaration
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c47-define-and-initialize-member-variables-in-the-order-of-member-declaration[C.47: Define and initialize member variables in the order of member declaration]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -59,8 +59,8 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers[{cpp} Core Guidelines C.48] - Prefer in-class initializers to member initializers in constructors for constant initializers
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c49-prefer-initialization-to-assignment-in-constructors[{cpp} Core Guidelines C.49] - Prefer initialization to assignment in constructors
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers[C.48: Prefer in-class initializers to member initializers in constructors for constant initializers]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c49-prefer-initialization-to-assignment-in-constructors[C.49: Prefer initialization to assignment in constructors]
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final[C.128 - Virtual functions should specify exactly one of virtual, override, or final]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final[C.128: Virtual functions should specify exactly one of `virtual`, `override`, or `final`]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -69,7 +69,7 @@ struct Book {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c30-define-a-destructor-if-a-class-needs-an-explicit-action-at-object-destruction[{cpp} Core Guidelines C.30] - Define a destructor if a class needs an explicit action at object destruction
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c30-define-a-destructor-if-a-class-needs-an-explicit-action-at-object-destruction[C.30: Define a destructor if a class needs an explicit action at object destruction]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -141,7 +141,7 @@ std::optional<int> safe_division(int a, int b) {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md[ES.105: Don't divide by integer zero]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es105-dont-divide-by-integer-zero[ES.105: Don't divide by integer zero]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -88,7 +88,7 @@ void example(fruit f) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#enum2-use-enumerations-to-represent-sets-of-related-named-constants[{cpp} Core Guidelines - Enum.2] - Use enumerations to represent sets of related named constants
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#enum2-use-enumerations-to-represent-sets-of-related-named-constants[Enum.2: Use enumerations to represent sets of related named constants]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
== Resources
|
||||
|
||||
* CppCoreGuidelines, Type safety profile - Type.1: Don't use reinterpret_cast.
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#prosafety-type-safety-profile[Type.1: Avoid casts]
|
||||
|
@ -78,7 +78,7 @@ When the enum is a private class member, the class encapsulates its use, and the
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#enum3-prefer-class-enums-over-plain-enums[Enum.3 - Prefer class enums over “plain” enums]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#enum3-prefer-class-enums-over-plain-enums[Enum.3: Prefer class enums over "plain" enums]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -25,7 +25,7 @@ Container container;
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Rc-standalone[{cpp} Core Guidelines C.7] - Don't define a class or enum and declare a variable of its type in the same statement
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c7-dont-define-a-class-or-enum-and-declare-a-variable-of-its-type-in-the-same-statement[C.7: Don't define a class or enum and declare a variable of its type in the same statement]
|
||||
|
||||
|
||||
|
||||
|
@ -77,7 +77,7 @@ Const member variables and reference member variables are ignored since they don
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp}:2008, 11-0-1 - Member data in non-POD class types shall be private.
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c133-avoid-protected-data[ C.133 - Avoid protected data]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c133-avoid-protected-data[C.133: Avoid `protected` data]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -46,8 +46,8 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c60-make-copy-assignment-non-virtual-take-the-parameter-by-const-and-return-by-non-const[{cpp} Core Guidelines C.60] - Make copy assignment non-virtual, take the parameter by const&, and return by non-const&
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c63-make-move-assignment-non-virtual-take-the-parameter-by\--and-return-by-non-const-[{cpp} Core Guidelines C.63] - Make move assignment non-virtual, take the parameter by &&, and return by non-const &
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c60-make-copy-assignment-non-virtual-take-the-parameter-by-const-and-return-by-non-const[C.60: Make copy assignment non-`virtual`, take the parameter by `const&`, and return by non-`const&`]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c63-make-move-assignment-non-virtual-take-the-parameter-by--and-return-by-non-const[C.63: Make move assignment non-`virtual`, take the parameter by `&&`, and return by non-`const&`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -39,7 +39,7 @@ User volatile * pvUser;
|
||||
== Resources
|
||||
|
||||
* https://wiki.sei.cmu.edu/confluence/display/c/CON02-C.+Do+not+use+volatile+as+a+synchronization+primitive[CERT CON02-C] - Do not use volatile as a synchronization primitive
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cp200-use-volatile-only-to-talk-to-non-c-memory[{cpp} Core Guidelines CP.200] - Use volatile only to talk to non-{cpp} memory
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp200-use-volatile-only-to-talk-to-non-c-memory[CP.200: Use `volatile` only to talk to non-{cpp} memory]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -30,7 +30,7 @@ struct Foo {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c87-beware-of\--on-base-classes[{cpp} Core Guidelines C.87] - Beware of ++==++ on base classes
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c87-beware-of--on-base-classes[C.87: Beware of `==` on base classes]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -34,7 +34,7 @@ try {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Re-exception-types[{cpp} Core Guidelines E.14] - Use purpose-designed user-defined types as exceptions (not built-in types)
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#e14-use-purpose-designed-user-defined-types-as-exceptions-not-built-in-types[E.14: Use purpose-designed user-defined types as exceptions (not built-in types)]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -29,7 +29,7 @@ void usage()
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es47-use-nullptr-rather-than-0-or-null[ES.47 - Use nullptr rather than 0 or NULL]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es47-use-nullptr-rather-than-0-or-null[ES.47: Use `nullptr` rather than `0` or `NULL`]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -50,7 +50,7 @@ void drawAll(std::vector<std::unique_ptr<Shape>> v)
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r32-take-a-unique_ptrwidget-parameter-to-express-that-a-function-assumes-ownership-of-a-widget[R.32 - Take a unique_ptr<widget> parameter to express that a function assumes ownership of a widget]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r32-take-a-unique_ptrwidget-parameter-to-express-that-a-function-assumes-ownership-of-a-widget[R.32: Take a `unique_ptr<widget>` parameter to express that a function assumes ownership of a `widget`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -50,8 +50,8 @@ class Process {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#i4-make-interfaces-precisely-and-strongly-typed[{cpp} Core Guidelines I.4] - Make interfaces precisely and strongly typed
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#t3-use-templates-to-express-containers-and-ranges[{cpp} Core Guidelines T.3] - Use templates to express containers and ranges
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#i4-make-interfaces-precisely-and-strongly-typed[I.4: Make interfaces precisely and strongly typed]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t3-use-templates-to-express-containers-and-ranges[T.3: Use templates to express containers and ranges]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -55,8 +55,8 @@ void swap(A& a1, A& a2) noexcept;
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c66-make-move-operations-noexcept[C.66 - Make move operations ``++noexcept++``]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c85-make-swap-noexcept[C.85 - Make swap operations ``++noexcept++``]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c66-make-move-operations-noexcept[C.66: Make move operations `noexcept`]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c85-make-swap-noexcept[C.85: Make `swap` `noexcept`]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -55,7 +55,7 @@ class A {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f54-if-you-capture-this-capture-all-variables-explicitly-no-default-capture[{cpp} Core Guidelines F.54] - If you capture ``++this++``, capture all variables explicitly (no default capture)
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f54-when-writing-a-lambda-that-captures-this-or-any-class-data-member-dont-use--default-capture[F.54: When writing a lambda that captures `this` or any class data member, don't use ``++[=]++`` default capture]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -53,8 +53,8 @@ If the result of a new is immediately passed as an argument to a function, we as
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r11-avoid-calling-new-and-delete-explicitly[{cpp} Core Guidelines R.11] - Avoid calling new and delete explicitly
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c149-use-unique_ptr-or-shared_ptr-to-avoid-forgetting-to-delete-objects-created-using-new[{cpp} Core Guidelines C.149] - Use unique_ptr or shared_ptr to avoid forgetting to delete objects created using new
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r11-avoid-calling-new-and-delete-explicitly[R.11: Avoid calling `new` and `delete` explicitly]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c149-use-unique_ptr-or-shared_ptr-to-avoid-forgetting-to-delete-objects-created-using-new[C.149: Use `unique_ptr` or `shared_ptr` to avoid forgetting to `delete` objects created using `new`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -33,8 +33,8 @@ enum class Actions {Left, Right, Jump, Shoot};
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es31-dont-use-macros-for-constants-or-functions[{cpp} Core Guidelines - ES.31] - Don’t use macros for constants or “functions”
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#enum1-prefer-enumerations-over-macros[{cpp} Core Guidelines - Enum.1] - Prefer enumerations over macros
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es31-dont-use-macros-for-constants-or-functions[ES.31: Don't use macros for constants or "functions"]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#enum1-prefer-enumerations-over-macros[Enum.1: Prefer enumerations over macros]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -31,7 +31,7 @@ void f() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es84-dont-try-to-declare-a-local-variable-with-no-name[{cpp} Core Guidelines ES.84] - Don’t (try to) declare a local variable with no name
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es84-dont-try-to-declare-a-local-variable-with-no-name[ES.84: Don't try to declare a local variable with no name]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -51,7 +51,7 @@ private:
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#t40-use-function-objects-to-pass-operations-to-algorithms[{cpp} Core Guidelines T.40] - Use function objects to pass operations to algorithms
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t40-use-function-objects-to-pass-operations-to-algorithms[T.40: Use function objects to pass operations to algorithms]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -56,7 +56,7 @@ This rule ignores virtual functions, that don't work well with templates.
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#t49-where-possible-avoid-type-erasure[{cpp} Core Guidelines T.49] - Where possible, avoid type-erasure
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t49-where-possible-avoid-type-erasure[T.49: Where possible, avoid type-erasure]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -73,7 +73,7 @@ std::size_t elementsCount(const std::vector<T>& vec) {
|
||||
|
||||
* MISRA C:2004, 16.1 - Functions shall not be defined with a variable number of arguments.
|
||||
* https://wiki.sei.cmu.edu/confluence/x/5ns-BQ[CERT, DCL50-CPP.] - Do not define a C-style variadic function
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#-es34-dont-define-a-c-style-variadic-function[{cpp} Core Guidelines ES.34] Don't define a (C-style) variadic function
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#-es34-dont-define-a-c-style-variadic-function[ES.34: Don't define a (C-style) variadic function]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -64,7 +64,7 @@ A f() {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#reason-62[F.48: Don’t return std::move(local)]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f48-dont-return-stdmovelocal[F.48: Don't `return std::move(local)`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -200,7 +200,7 @@ the ABA problem, where `A` and `B` refers to the values of the resource.
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#cp43-minimize-time-spent-in-a-critical-section[CP.43: Minimize time spent in a critical section]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp43-minimize-time-spent-in-a-critical-section[CP.43: Minimize time spent in a critical section]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -102,7 +102,7 @@ Exceptions classes must be copyable. Hence, this rule does not apply to exceptio
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c67-a-polymorphic-class-should-suppress-copying[{cpp} Core Guidelines C.67] - A polymorphic class should suppress copying
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c67-a-polymorphic-class-should-suppress-public-copymove[C.67: A polymorphic class should suppress public copy/move]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -80,7 +80,7 @@ int main(){
|
||||
== Resources
|
||||
|
||||
* https://www.modernescpp.com/index.php/c-core-guidelines-be-aware-of-the-traps-of-condition-variables[The traps of condition variables]
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#cp42-dont-wait-without-a-condition[{cpp} Core Guidelines - CP.42] - Don't wait without a condition
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp42-dont-wait-without-a-condition[CP.42: Don't `wait` without a condition]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -57,7 +57,7 @@ int main() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c152-never-assign-a-pointer-to-an-array-of-derived-class-objects-to-a-pointer-to-its-base[{cpp} Core Guidelines C.152] - Never assign a pointer to an array of derived class objects to a pointer to its base
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c152-never-assign-a-pointer-to-an-array-of-derived-class-objects-to-a-pointer-to-its-base[C.152: Never assign a pointer to an array of derived class objects to a pointer to its base]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -40,7 +40,7 @@ std::unordered_set<Customer, MyHash> mySet;
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c89-make-a-hash-noexcept[C.89 - Make a hash noexcept]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c89-make-a-hash-noexcept[C.89: Make a `hash` `noexcept`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -58,8 +58,8 @@ private:
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c134-ensure-all-non-const-data-members-have-the-same-access-level[C.134: Ensure all non-const data members have the same access level]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c9-minimize-exposure-of-members[C.9: Minimize exposure of members]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c134-ensure-all-non-const-data-members-have-the-same-access-level[C.134: Ensure all non-`const` data members have the same access level]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c9-minimize-exposure-of-members[C.9: Minimize exposure of members]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -67,7 +67,7 @@ void test() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es56-write-stdmove-only-when-you-need-to-explicitly-move-an-object-to-another-scope[{cpp} Core Guidelines ES.56] - Write "std::move()" only when you need to explicitly move an object to another scope
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es56-write-stdmove-only-when-you-need-to-explicitly-move-an-object-to-another-scope[ES.56: Write `std::move()` only when you need to explicitly move an object to another scope]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -23,7 +23,7 @@ using FunctionPointerType = void (*)(int);
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#t43-prefer-using-over-typedef-for-defining-aliases[{cpp} Core Guidelines - T.43] - Prefer using over typedef for defining aliases
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#t43-prefer-using-over-typedef-for-defining-aliases[T.43: Prefer `using` over `typedef` for defining aliases]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -87,8 +87,8 @@ struct C {
|
||||
* {cpp} reference - https://en.cppreference.com/w/cpp/utility/move[std::move]
|
||||
* {cpp} reference - https://en.cppreference.com/w/cpp/utility/forward[std::forward]
|
||||
* {cpp} reference - https://en.cppreference.com/w/cpp/language/reference#Forwarding_references[Forwarding references]
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f18-for-will-move-from-parameters-pass-by-x-and-stdmove-the-parameter[{cpp} Core Guidelines F.18] - For “will-move-from” parameters, pass by ``++X&&++`` and ``++std::move++`` the parameter
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f19-for-forward-parameters-pass-by-tp-and-only-stdforward-the-parameter[{cpp} Core Guidelines F.19] - For “forward” parameters, pass by ``++TP&&++`` and only ``++std::forward++`` the parameter
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f18-for-will-move-from-parameters-pass-by-x-and-stdmove-the-parameter[F.18: For "will-move-from" parameters, pass by `X&&` and `std::move` the parameter]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f19-for-forward-parameters-pass-by-tp-and-only-stdforward-the-parameter[F.19: For "forward" parameters, pass by `TP&&` and only `std::forward` the parameter]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -54,7 +54,7 @@ double f() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#i4-make-interfaces-precisely-and-strongly-typed[{cpp} Core Guidelines I.4] - Make interfaces precisely and strongly typed
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#i4-make-interfaces-precisely-and-strongly-typed[I.4: Make interfaces precisely and strongly typed]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -46,7 +46,7 @@ int main() {
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#i2-avoid-non-const-global-variables[I.2 - Avoid non-const global variables]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#i2-avoid-non-const-global-variables[I.2: Avoid non-`const` global variables]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -58,8 +58,8 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers[{cpp} core guidelines C.48]: Prefer in-class initializers to member initializers in constructors for constant initializers
|
||||
* http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c49-prefer-initialization-to-assignment-in-constructors[{cpp} core guidelines C.49]: Prefer initialization to assignment in constructors
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers[C.48: Prefer in-class initializers to member initializers in constructors for constant initializers]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c49-prefer-initialization-to-assignment-in-constructors[C.49: Prefer initialization to assignment in constructors]
|
||||
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ int main() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f19-for-forward-parameters-pass-by-tp-and-only-stdforward-the-parameter[{cpp} Core Guidelines F.19] - For “forward” parameters, pass by TP&& and only std::forward the parameter
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f19-for-forward-parameters-pass-by-tp-and-only-stdforward-the-parameter[F.19: For "forward" parameters, pass by `TP&&` and only `std::forward` the parameter]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -52,6 +52,6 @@ Vec applyPermutation(const Vec& v, const Vec& permutation) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f52-prefer-capturing-by-reference-in-lambdas-that-will-be-used-locally-including-passed-to-algorithms[{cpp} Core Guidelines F.52] - Prefer capturing by reference in lambdas that will be used locally, including passed to algorithms
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f52-prefer-capturing-by-reference-in-lambdas-that-will-be-used-locally-including-passed-to-algorithms[F.52: Prefer capturing by reference in lambdas that will be used locally, including passed to algorithms]
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f18-for-will-move-from-parameters-pass-by-x-and-stdmove-the-parameter[{cpp} Core Guidelines F.18] - For “will-move-from” parameters, pass by X&& and std::move the parameter
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f18-for-will-move-from-parameters-pass-by-x-and-stdmove-the-parameter[F.18: For "will-move-from" parameters, pass by `X&&` and `std::move` the parameter]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -73,7 +73,7 @@ void f() {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r13-perform-at-most-one-explicit-resource-allocation-in-a-single-expression-statement[R.13 - Perform at most one explicit resource allocation in a single expression statement]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r13-perform-at-most-one-explicit-resource-allocation-in-a-single-expression-statement[R.13: Perform at most one explicit resource allocation in a single expression statement]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -49,7 +49,7 @@ void f(Base *b) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c148-use-dynamic_cast-to-a-pointer-type-when-failure-to-find-the-required-class-is-considered-a-valid-alternative[{cpp} Core Guidelines C.148] - Use dynamic_cast to a pointer type when failure to find the required class is considered a valid alternative
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c148-use-dynamic_cast-to-a-pointer-type-when-failure-to-find-the-required-class-is-considered-a-valid-alternative[C.148: Use `dynamic_cast` to a pointer type when failure to find the required class is considered a valid alternative]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -82,7 +82,7 @@ bool storeIfRelevantInSharedContext(const DataItem &dataItem) {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#cp20-use-raii-never-plain-lockunlock[CP.20 - Use RAII, never plain lock()/unlock()]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp20-use-raii-never-plain-lockunlock[CP.20: Use RAII, never plain `lock()`/`unlock()`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -46,7 +46,7 @@ void f1() {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#r37-do-not-pass-a-pointer-or-reference-obtained-from-an-aliased-smart-pointer[{cpp} Core Guidelines R.37] - Do not pass a pointer or reference obtained from an aliased smart pointer
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r37-do-not-pass-a-pointer-or-reference-obtained-from-an-aliased-smart-pointer[R.37: Do not pass a pointer or reference obtained from an aliased smart pointer]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -91,7 +91,7 @@ Buffers can be left uninitialized as long as they are written into immediately a
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es20-always-initialize-an-object[{cpp} Core Guidelines ES.20] - Always initialize an object
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es20-always-initialize-an-object[ES.20: Always initialize an object]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -55,7 +55,7 @@ void f() { // Compliant: C++17 solution
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#cp21-use-stdlock-or-stdscoped_lock-to-acquire-multiple-mutexes[{cpp} Core Guidelines CP.21] - Use std::lock() or std::scoped_lock to acquire multiple mutexes
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp21-use-stdlock-or-stdscoped_lock-to-acquire-multiple-mutexes[CP.21: Use `std::lock()` or `std::scoped_lock` to acquire multiple ``mutex``es]
|
||||
* {cpp} reference - https://en.cppreference.com/w/cpp/thread/scoped_lock[cppreference.com - std::scoped_lock]
|
||||
|
||||
|
||||
|
@ -112,8 +112,8 @@ void f(vector<int> &v) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es71-prefer-a-range-for-statement-to-a-for-statement-when-there-is-a-choice[{cpp} Core Guidelines ES.71] - Prefer a range-for-statement to a for-statement when there is a choice
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#p3-express-intent[{cpp} Core Guidelines P.3] - Express intent
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es71-prefer-a-range-for-statement-to-a-for-statement-when-there-is-a-choice[ES.71: Prefer a range-`for`-statement to a `for`-statement when there is a choice]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#p3-express-intent[P.3: Express intent]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -28,7 +28,7 @@ This rule does not apply to overloaded operators because they respect the sequen
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es44-dont-depend-on-order-of-evaluation-of-function-arguments[{cpp} Core Guidelines ES.44] - Don't depend on order of evaluation of function arguments
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es44-dont-depend-on-order-of-evaluation-of-function-arguments[ES.44: Don't depend on order of evaluation of function arguments]
|
||||
* {cpp} reference - https://en.cppreference.com/w/cpp/language/eval_order[cppreference.com - order of evaluation]
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ void f1 ( )
|
||||
|
||||
* MISRA C:2004, 17.3 - >, >=, <, +<=+ shall not be applied to pointer types except where they point to the same array.
|
||||
* MISRA {cpp}:2008, 5-0-18 - >, >=, <, +<=+ shall not be applied to objects of pointer type, except where they point to the same array.
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es62-dont-compare-pointers-into-different-arrays[{cpp} Core Guidelines ES.62] - Don't compare pointers into different arrays
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es62-dont-compare-pointers-into-different-arrays[ES.62: Don't compare pointers into different arrays]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -45,7 +45,7 @@ The rule S6234 detects other situations where `auto` can improve readability.
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es11-use-auto-to-avoid-redundant-repetition-of-type-names[{cpp} Core Guidelines ES.11] - Use auto to avoid redundant repetition of type names
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names[ES.11: Use `auto` to avoid redundant repetition of type names]
|
||||
|
||||
=== Related rules
|
||||
|
||||
|
@ -112,7 +112,7 @@ vector<int> v = { 1, 2, 4 };
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/8e82f0a0d9ba3992af2d61480250e1c577df4a28/CppCoreGuidelines.md#es23-prefer-the\--initializer-syntax[{cpp} Core Guidelines ES.23] - Prefer the {} initializer syntax
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es23-prefer-the--initializer-syntax[ES.23: Prefer the `{}`-initializer syntax]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -130,6 +130,5 @@ This goes well in hand with non-copyable classes.
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines -
|
||||
https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es63-dont-slice[ES.63 Don't slice]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es63-dont-slice[ES.63: Don't slice]
|
||||
|
||||
|
@ -47,7 +47,7 @@ This rule will not report the use of C-style arrays in ``++extern "C"++`` code (
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/46dadd0b16b904fe0ff88c1fef9b0702dfd139e2/CppCoreGuidelines.md#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array[SL.con.1 - Prefer using STL array or vector instead of a C array]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#slcon1-prefer-using-stl-array-or-vector-instead-of-a-c-array[SL.con.1: Prefer using STL `array` or `vector` instead of a C array]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -51,7 +51,7 @@ How are you?
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/c553535fb8dda2839d13ab5f807ffbc66b63d67b/CppCoreGuidelines.md#sl50-avoid-endl[{cpp} Core Guidelines SL.50] - Avoid endl
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#slio50-avoid-endl[SL.io.50: Avoid `endl`]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -71,8 +71,8 @@ In addition, `make_shared` does not support the following:
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp] Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c150-use-make_unique-to-construct-objects-owned-by-unique_ptrs[C.150 - Use make_unique() to construct objects owned by unique_ptrs]
|
||||
* {cpp] Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c151-use-make_shared-to-construct-objects-owned-by-shared_ptrs[C.151 - Use make_shared() to construct objects owned by shared_ptrs]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c150-use-make_unique-to-construct-objects-owned-by-unique_ptrs[C.150: Use `make_unique()` to construct objects owned by ``unique_ptr``s]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c151-use-make_shared-to-construct-objects-owned-by-shared_ptrs[C.151: Use `make_shared()` to construct objects owned by ``shared_ptr``s]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -47,5 +47,5 @@ A f();
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/c553535fb8dda2839d13ab5f807ffbc66b63d67b/CppCoreGuidelines.md#enforcement-40[{cpp} Core Guidelines F.20] - Flag returning a const value.
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f20-for-out-output-values-prefer-return-values-to-output-parameters[F.20: For "out" output values, prefer return values to output parameters]
|
||||
|
||||
|
@ -63,7 +63,7 @@ class Derived : public Base {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/9efcaf07f7013fb6d07ee004f936540164535c63/CppCoreGuidelines.md#c52-use-inheriting-constructors-to-import-constructors-into-a-derived-class-that-does-not-need-further-explicit-initialization[{cpp} Core Guidelines C.52] - Use inheriting constructors to import constructors into a derived class that does not need further explicit initialization
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c52-use-inheriting-constructors-to-import-constructors-into-a-derived-class-that-does-not-need-further-explicit-initialization[C.52: Use inheriting constructors to import constructors into a derived class that does not need further explicit initialization]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -38,5 +38,5 @@ The move constructor of the ``++shared_ptr++`` itself.
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/c553535fb8dda2839d13ab5f807ffbc66b63d67b/CppCoreGuidelines.md#r34-take-a-shared_ptrwidget-parameter-to-express-that-a-function-is-part-owner[{cpp} Core Guidelines R.34] - Warn if a function takes a Shared_ptr<T> by rvalue reference. Suggesting taking it by value instead.
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#r34-take-a-shared_ptrwidget-parameter-to-express-shared-ownership[R.34: Take a `shared_ptr<widget>` parameter to express shared ownership]
|
||||
|
||||
|
@ -34,7 +34,7 @@ void f() {
|
||||
|
||||
== Resources
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es5-keep-scopes-small[ES.5 - Keep scopes small]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es5-keep-scopes-small[ES.5: Keep scopes small]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -35,5 +35,5 @@ void startBackgroundTask(){
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#cp26-dont-detach-a-thread[{cpp} Core Guidelines CP.26] - Don't detach() a thread
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp26-dont-detach-a-thread[CP.26: Don't `detach()` a thread]
|
||||
|
||||
|
@ -67,7 +67,7 @@ double computeArea(const Shape* shape) {
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/c553535fb8dda2839d13ab5f807ffbc66b63d67b/CppCoreGuidelines.md#type2-dont-use-static_cast-downcasts-use-dynamic_cast-instead[{cpp} Core Guidelines - Type safety profile - Type.2]: Don’t use static_cast to downcast. Use dynamic_cast instead.
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#prosafety-type-safety-profile[Type.2: Don’t use `static_cast` to downcast]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -61,6 +61,6 @@ void printingMap(const std::map<int, std::string>& map) {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#reason-48[F.21 - To return multiple “out” values, prefer returning a struct or tuple]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f21-to-return-multiple-out-values-prefer-returning-a-struct-or-tuple[F.21: To return multiple "out" values, prefer returning a struct or tuple]
|
||||
|
||||
|
||||
|
@ -39,5 +39,5 @@ int main() {
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#cp25-prefer-gsljoining_thread-over-stdthread[CP.25 - Prefer "gsl::joining_thread" over "std::thread"]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#cp25-prefer-gsljoining_thread-over-stdthread[CP.25: Prefer `gsl::joining_thread` over `std::thread`]
|
||||
|
||||
|
@ -29,7 +29,7 @@ const long double tau = 6.28L;
|
||||
|
||||
== Resources
|
||||
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rl-const[{cpp} Core Guidelines NL.26] - Use conventional const notation
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#nl26-use-conventional-const-notation[NL.26: Use conventional `const` notation]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -59,7 +59,7 @@ Some people use ``++!!++`` as a shortcut to cast an integer to bool. This usage
|
||||
* MISRA C:2004, 12.6 - The operands of logical operators (&&, || and !) should be effectively Boolean. Expressions that are effectively Boolean should not be used as operands to operators other than (&&, || and !).
|
||||
* MISRA {cpp}:2008, 5-3-1 - Each operand of the ! operator, the logical && or the logical || operators shall have type bool.
|
||||
* https://wiki.sei.cmu.edu/confluence/display/c/EXP13-C.+Treat+relational+and+equality+operators+as+if+they+were+nonassociative[CERT, EXP13-C.] - Treat relational and equality operators as if they were nonassociative
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es87-dont-add-redundant\--or\--to-conditions[{cpp} Core Guidelines ES.87] - Don’t add redundant ++==++ or != to conditions
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es87-dont-add-redundant--or--to-conditions[ES.87: Don't add redundant `==` or `!=` to conditions]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -33,7 +33,7 @@ void f2 ( A & a )
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp} 2008, 5-3-3 - The unary & operator shall not be overloaded.
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#Ro-address-of[{cpp} Core Guidelines C.166] - Overload unary ``++&++`` only as part of a system of smart pointers and references
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c166-overload-unary--only-as-part-of-a-system-of-smart-pointers-and-references[C.166: Overload unary `&` only as part of a system of smart pointers and references]
|
||||
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ for (int i = 0; i < 10; i++) {
|
||||
|
||||
* MISRA C:2004, 14.4 - The goto statement shall not be used.
|
||||
* MISRA C:2012, 15.1 - The goto statement should not be used
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es76-avoid-goto[{cpp} Core Guidelines ES.76]: Avoid goto
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es76-avoid-goto[ES.76: Avoid `goto`]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
|
@ -19,5 +19,5 @@ void MyPrintf ( char_t * pFormat, ... ) // Noncompliant
|
||||
* MISRA C:2004, 16.1 - Functions shall not be defined with a variable number of arguments.
|
||||
* MISRA {cpp}:2008, 8-4-1 - Functions shall not be defined using the ellipsis notation.
|
||||
* https://wiki.sei.cmu.edu/confluence/x/5ns-BQ[CERT, DCL50-CPP.] - Do not define a C-style variadic function
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#-es34-dont-define-a-c-style-variadic-function[{cpp} Core Guidelines ES.34] Don't define a (C-style) variadic function
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#f55-dont-use-va_arg-arguments[{cpp} Core Guidelines F.55] Don't use va_arg arguments
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#-es34-dont-define-a-c-style-variadic-function[ES.34: Don't define a (C-style) variadic function]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#f55-dont-use-va_arg-arguments[F.55: Don't use `va_arg` arguments]
|
||||
|
@ -44,7 +44,7 @@ void b ()
|
||||
== Resources
|
||||
|
||||
* MISRA {cpp}:2008, 5-2-12 - An identifier with array type passed as a function argument shall not decay to a pointer.
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#i13-do-not-pass-an-array-as-a-single-pointer[{cpp} Core Guidelines I.13] - Do not pass an array as a single pointer
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#i13-do-not-pass-an-array-as-a-single-pointer[I.13: Do not pass an array as a single pointer]
|
||||
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ void func(void) {
|
||||
* MISRA {cpp}:2008, 16-0-4 - Function-like macros shall not be defined.
|
||||
* MISRA C:2012, Dir. 4.9 - A function should be used in preference to a function-like macro where they are interchangeable
|
||||
* https://wiki.sei.cmu.edu/confluence/x/INcxBQ[CERT, PRE00-C.] - Prefer inline or static functions to function-like macros
|
||||
* https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#es31-dont-use-macros-for-constants-or-functions[{cpp} Core Guidelines ES.31] - Don't use macros for constants or "functions"
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#es31-dont-use-macros-for-constants-or-functions[ES.31: Don't use macros for constants or "functions"]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
@ -36,8 +36,8 @@ include::{docdir}/documentation.adoc[]
|
||||
|
||||
=== External coding guidelines
|
||||
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c36-a-destructor-may-not-fail[C.36 A destructor may not fail]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/036324/CppCoreGuidelines.md#c37-make-destructors-noexcept[C.37 Make destructors noexcept]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c36-a-destructor-must-not-fail[C.36: A destructor must not fail]
|
||||
* {cpp} Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/e49158a/CppCoreGuidelines.md#c37-make-destructors-noexcept[C.37: Make destructors `noexcept`]
|
||||
* MISRA {cpp}:2008, 15-5-1 - A class destructor shall not exit with an exception.
|
||||
|
||||
=== Related rules
|
||||
|
Loading…
x
Reference in New Issue
Block a user