From fd3d7083b0e82f5856c05d88d61ceb3cdb991c89 Mon Sep 17 00:00:00 2001 From: Jordan Neidlinger Date: Wed, 23 Sep 2015 13:12:40 -0700 Subject: [PATCH 1/4] [Typo] Fix typo in function definition rule 5 --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f28366f..946c67b 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1816,7 +1816,7 @@ The compiler gives an error if a non-`constexpr` function is called where a cons ### F.5: If a function is very small and time critical, declare it `inline` -**Reason**: Some optimizers are good an inlining without hints from the programmer, but don't rely on it. +**Reason**: Some optimizers are good at inlining without hints from the programmer, but don't rely on it. Measure! Over the last 40 years or so, we have been promised compilers that can inline better than humans without hints from humans. We are still waiting. Specifying `inline` encourages the compiler to do a better job. From 0776c5884779d72bf69470bcaee40b193a848dee Mon Sep 17 00:00:00 2001 From: Gabriele Carrettoni Date: Wed, 23 Sep 2015 22:21:18 +0200 Subject: [PATCH 2/4] Fix typo rule C.42 runrime -> runtime --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f28366f..6048f1b 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3513,7 +3513,7 @@ The idiom of having constructors acquire resources and destructors release them X2(const string& name) :f{fopen(name.c_str(),"r"} { - if (f==nullptr) throw runrime_error{"could not open" + name}; + if (f==nullptr) throw runtime_error{"could not open" + name}; // ... } From b370731cc9c6e9fd1616780026fb70e54442c99a Mon Sep 17 00:00:00 2001 From: Jordan Neidlinger Date: Wed, 23 Sep 2015 13:25:25 -0700 Subject: [PATCH 3/4] [Typo] Fix typo in function argument passing rule 21 --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f28366f..07215b9 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2128,7 +2128,7 @@ Suggest using a `const` reference instead. ### F.21: Use a `T` parameter for a small object **Reason**: Nothing beats the simplicity and safety of copying. -For small objects (up to two or three words) is is also faster than alternatives. +For small objects (up to two or three words) it is also faster than alternatives. **Example**: From 4beff8a602dc6f7d2a798e2f216496ae741a5dce Mon Sep 17 00:00:00 2001 From: Blake Hawkins Date: Wed, 23 Sep 2015 21:29:00 +0100 Subject: [PATCH 4/4] fix invalid local anchor links Many local named anchors had slightly incorrect addresses. This fixes a few of them. --- CppCoreGuidelines.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f28366f..5bb1da6 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2644,7 +2644,7 @@ Subsections: * [C.ctor: Constructors, assignments, and destructors](#SS-ctor) * [C.con: Containers and other resource handles](#SS-containers) * [C.lambdas: Function objects and lambdas](#SS-lambdas) -* [C.hier: Class hierarchies (OOP)](SS-hier) +* [C.hier: Class hierarchies (OOP)](#SS-hier) * [C.over: Overloading and overloaded operators](#SS-overload) * [C.union: Unions](#SS-union) @@ -4455,7 +4455,7 @@ Note that calling a specific explicitly qualified function is not a virtual call ### C.83: For value-like types, consider providing a `noexcept` swap function -**Reason**: A `swap` can be handy for implementing a number of idioms, from smoothly moving objects around to implementing assignment easily to providing a guaranteed commit function that enables strongly error-safe calling code. Consider using swap to implement copy assignment in terms of copy construction. See also [destructors, deallocation, and swap must never fail]("#Re-never-fail). +**Reason**: A `swap` can be handy for implementing a number of idioms, from smoothly moving objects around to implementing assignment easily to providing a guaranteed commit function that enables strongly error-safe calling code. Consider using swap to implement copy assignment in terms of copy construction. See also [destructors, deallocation, and swap must never fail](#Re-never-fail). **Example; good**: @@ -6331,7 +6331,7 @@ Statement rules: Arithmetic rules: -* [ES.100: Don't mix signed and unsigned arithmetic](Res-mix) +* [ES.100: Don't mix signed and unsigned arithmetic](#Res-mix) * [ES.101: use unsigned types for bit manipulation](#Res-unsigned) * [ES.102: Used signed types for arithmetic](#Res-signed) * [ES.103: Don't overflow](#Res-overflow) @@ -8974,7 +8974,7 @@ Concept use rule summary: * [T.10: Specify concepts for all template arguments](#Rt-concepts) * [T.11: Whenever possible use standard concepts](#Rt-std) * [T.14: Prefer concept names over `auto`](#Rt-auto) -* [T.15: Prefer the shorthand notation for simple, single-type argument concepts](Rt-shorthand) +* [T.15: Prefer the shorthand notation for simple, single-type argument concepts](#Rt-shorthand) * ??? Concept definition rule summary: @@ -9992,7 +9992,7 @@ For example, if you really need AST manipulation at compile time (e.g., for opti enable_if -Instead, use concepts. But see [How to emulate concepts if you don't have language support]("#Rt-emulate"). +Instead, use concepts. But see [How to emulate concepts if you don't have language support](#Rt-emulate). **Example**: @@ -10226,7 +10226,7 @@ Many attempts have been made to keep them compatible, but neither is a subset of C rule summary: -* [CPL.1: Prefer C++ to C](Rcpl-C) +* [CPL.1: Prefer C++ to C](#Rcpl-C) * [CPL.2: If you must use C, use the common subset of C and C++, and compile the C code as C++](#Rcpl-subset) * [CPL.3: If you must use C for interfaces, use C++ in the code using such interfaces](#Rcpl-interface) @@ -11444,7 +11444,7 @@ Naming and layout rules: * [NL.5: Don't encode type information in names](#Rl-name-type) * [NL.6: Make the length of a name roughly proportional to the length of its scope](#Rl-name-length) * [NL.7: Use a consistent naming style](#Rl-name) -* [NL 9: Use ALL_CAPS for macro names only](Rl-space) +* [NL 9: Use ALL_CAPS for macro names only](#Rl-space) * [NL.10: Avoid CamelCase](#Rl-camel) * [NL.15: Use spaces sparingly](#Rl-space) * [NL.16: Use a conventional class member declaration order](#Rl-order)