From 0f57785d2b6a9314efd2385b618bb5e6243e5cfc Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 15 Apr 2019 12:06:50 -0600 Subject: [PATCH] C.129 Small fixes (#1406) * C.129 Fix typos and conjugation I noticed some grammatical errors in this section and fixed them to match my interpretation of the author's intention. * One more fix Pluralization --- CppCoreGuidelines.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6605bf2..3930c15 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -7086,10 +7086,10 @@ The importance of keeping the two kinds of inheritance increases Problems: -* 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. +* As the hierarchy grows and more data is added to `Shape`, the constructors get harder to write and maintain. +* Why calculate the center for the `Triangle`? we may never use 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. +and all classes derived from `Shape` and all code using `Shape` will need to be reviewed, possibly changed, and probably recompiled. The implementation of `Shape::move()` is an example of implementation inheritance: we have defined `move()` once and for all for all derived classes. @@ -7113,7 +7113,7 @@ This Shape hierarchy can be rewritten using interface inheritance: // ... }; -Note that a pure interface rarely have constructors: there is nothing to construct. +Note that a pure interface rarely has constructors: there is nothing to construct. class Circle : public Shape { public: @@ -7134,7 +7134,7 @@ For example, `center` has to be implemented by every class derived from `Shape`. ##### Example, dual hierarchy -How can we gain the benefit of the stable hierarchies from implementation hierarchies and the benefit of implementation reuse from implementation inheritance. +How can we gain the benefit of stable hierarchies from implementation hierarchies and the benefit of implementation reuse from implementation inheritance? One popular technique is dual hierarchies. There are many ways of implementing the idea of dual hierarchies; here, we use a multiple-inheritance variant.