From b516c49efc86702772732ae505881e14b0b9984f Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:41:18 +0100 Subject: [PATCH 01/11] C.8: Fix typo in title and capitalize first word --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 0a5bf3d..e3f96d7 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3513,7 +3513,7 @@ Class rule summary: * [C.4: Make a function a member only if it needs direct access to the representation of a class](#Rc-member) * [C.5: Place helper functions in the same namespace as the class they support](#Rc-helper) * [C.7: Don't define a class or enum and declare a variable of its type in the same statement](#Rc-standalone) -* [C.8: use `class` rather that `struct` if any member is non-public](#Rc-class) +* [C.8: Use `class` rather than `struct` if any member is non-public](#Rc-class) * [C.9: minimize exposure of members](#Rc-private) Subsections: @@ -3708,7 +3708,7 @@ Mixing a type definition and the definition of another entity in the same declar * Flag if the `}` of a class or enumeration definition is not followed by a `;`. The `;` is missing. -### C.8: use `class` rather that `struct` if any member is non-public +### C.8: Use `class` rather than `struct` if any member is non-public ##### Reason From edb59eea86de1e9e7ad776499c992b7c9e37c704 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:43:03 +0100 Subject: [PATCH 02/11] C.8: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index e3f96d7..273dd03 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3731,7 +3731,7 @@ There is nothing wrong with this code as far as the C++ language rules are conce but nearly everything is wrong from a design perspective. The private data is hidden far from the public data. The data is split in different parts of the class declaration. -Different parts of the data has difference access. +Different parts of the data have different access. All of this decreases readability and complicates maintenance. ##### Note From 0d02b7e8bf2e7e262d4aa5df3d09ae0805c62d51 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:45:50 +0100 Subject: [PATCH 03/11] C.9: Capitalize first word of title --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 273dd03..1456975 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3514,7 +3514,7 @@ Class rule summary: * [C.5: Place helper functions in the same namespace as the class they support](#Rc-helper) * [C.7: Don't define a class or enum and declare a variable of its type in the same statement](#Rc-standalone) * [C.8: Use `class` rather than `struct` if any member is non-public](#Rc-class) -* [C.9: minimize exposure of members](#Rc-private) +* [C.9: Minimize exposure of members](#Rc-private) Subsections: @@ -3742,7 +3742,7 @@ Prefer to place the interface first in a class [see](#Rl-order). Flag classes declared with `struct` if there is a `private` or `public` member. -### C.9: minimize exposure of members +### C.9: Minimize exposure of members ##### Reason From db8273d068783326df9e1a5a8f23154d282fbddb Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:47:44 +0100 Subject: [PATCH 04/11] C.concrete: Fix typo in introductory text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 1456975..7b91bd2 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3771,7 +3771,7 @@ A value of regular type can be copied and the result of a copy is an independent If a concrete type has both `=` and `==`, `a = b` should result in `a == b` being `true`. Concrete classes without assignment and equality can be defined, but they are (and should be) rare. The C++ built-in types are regular, and so are standard-library classes, such as `string`, `vector`, and `map`. -Concrete types are also often referred to as value types to distinguish them from types uses as part of a hierarchy. +Concrete types are also often referred to as value types to distinguish them from types used as part of a hierarchy. Concrete type rule summary: From efb284388f6c5952eb25843e8b1d4ba39a4cbef8 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:48:43 +0100 Subject: [PATCH 05/11] C.defop: Fix typo in introductory text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 7b91bd2..9a28b7d 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -3935,7 +3935,7 @@ Other default operations rules: ## C.defop: Default Operations -By default, the language supply the default operations with their default semantics. +By default, the language supplies the default operations with their default semantics. However, a programmer can disable or replace these defaults. ### C.20: If you can avoid defining default operations, do From 7070ffa839be042e50536e116014ca0bc576823b Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:49:54 +0100 Subject: [PATCH 06/11] C.41: Add missing comma --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 9a28b7d..bfd0cf8 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -4542,7 +4542,7 @@ Compilers do not read comments. ##### Exception -If a valid object cannot conveniently be constructed by a constructor [use a factory function](#Rc-factory). +If a valid object cannot conveniently be constructed by a constructor, [use a factory function](#Rc-factory). ##### Note From 66c0348d1926fbacdbfc203310c42536056bd164 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:51:08 +0100 Subject: [PATCH 07/11] C.80: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index bfd0cf8..6adce97 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5512,7 +5512,7 @@ comparisons, `swap`, and `hash`. ##### Reason -The compiler is more likely to get the default semantics right and you cannot implement these function better than the compiler. +The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler. ##### Example From 434f995679749ba4fcf564848b4ba304c27761fa Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:53:58 +0100 Subject: [PATCH 08/11] C.128: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6adce97..1af112a 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6104,7 +6104,7 @@ Readability. Detection of mistakes. Writing explicit `virtual`, `override`, or `final` is self-documenting and enables the compiler to catch mismatch of types and/or names between base and derived classes. However, writing more than one of these three is both redundant and a potential source of errors. -Use `virtual` only when declaring a new virtual function. Use `override` only when declaring an overrider. Use `final` only when declaring an final overrider. If a base class destructor is declared `virtual`, derived class destructors should neither be declared `virtual` nor `override`. +Use `virtual` only when declaring a new virtual function. Use `override` only when declaring an overrider. Use `final` only when declaring a final overrider. If a base class destructor is declared `virtual`, derived class destructors should neither be declared `virtual` nor `override`. ##### Example, bad From fc0999c56ead753972c86eab9edb23155d31b4b2 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:54:52 +0100 Subject: [PATCH 09/11] C.129: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 1af112a..c08178d 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6204,7 +6204,7 @@ The importance of keeping the two kinds of inheritance increases Problems: -* As the hierarchy grows and more data is adder to `Shape`, the constructors gets harder to write and maintain. +* As the hierarchy grows and more data is added to `Shape`, the constructors gets harder to write and maintain. * Why calculate the center for the `Triangle`? we may never us it. * Add a data member to `Shape` (e.g., drawing style or canvas) and all derived classes and all users needs to be reviewed, possibly changes, and probably recompiled. From 26953e0bf9030a21021596c6b2ad0e857de9b520 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:55:54 +0100 Subject: [PATCH 10/11] C.139: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index c08178d..32983fd 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6621,7 +6621,7 @@ Too often, such claims are based on conjecture or experience with other language There are examples where `final` can be important for both logical and performance reasons. One example is a performance-critical AST hierarchy in a compiler or language analysis tool. New derived classes are not added every year and only by library implementers. -However, misuses are (or at least has been) far more common. +However, misuses are (or at least have been) far more common. ##### Enforcement From 353f8ffc4ce0bdf9b8e41c0fe4975c7cc31a874f Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 17 Nov 2016 14:56:45 +0100 Subject: [PATCH 11/11] C.140: Fix typo in text --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 32983fd..071ec8c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6632,7 +6632,7 @@ Flag uses of `final`. ##### Reason -That can cause confusion: An overrider do not inherit default arguments. +That can cause confusion: An overrider does not inherit default arguments. ##### Example, bad