diff --git a/2-ObjectProgramming/6-inheritance.ipynb b/2-ObjectProgramming/6-inheritance.ipynb index 3e17b3390229e84a5f99e28925d5fc4cdecdf818..ea13477f7af6ba3343857b4cbc04b412373e15fd 100644 --- a/2-ObjectProgramming/6-inheritance.ipynb +++ b/2-ObjectProgramming/6-inheritance.ipynb @@ -132,7 +132,7 @@ "\n", "### Multiple layer of inheritance\n", "\n", - "A child class may also be the parent of another class (unless `final` is used - see later)\n", + "A child class may also be the parent of another class (unless `final` keyword is used - we'll see this keyword in [polymorphism notebook](./7-polymorphism.ipynb#final-keyword)).\n", "\n" ] }, @@ -347,9 +347,9 @@ " \n", " private:\n", " \n", - " double width_ = -1.e20; // Stupid value that would play havoc if not properly initialized\n", + " double width_ { -1.e20 } ; // Stupid value that would play havoc if not properly initialized\n", " // - std::optional (C++17) would probably a better choice.\n", - " double length_ = -1.e20; \n", + " double length_ { -1.e20 } \n", "};" ] }, diff --git a/2-ObjectProgramming/7-polymorphism.ipynb b/2-ObjectProgramming/7-polymorphism.ipynb index 0a8362e458fcd7b03783d382727cd85319edd40c..e87af280ed5b12c1c1edd46f14dbc42ff2d9a01a 100644 --- a/2-ObjectProgramming/7-polymorphism.ipynb +++ b/2-ObjectProgramming/7-polymorphism.ipynb @@ -942,7 +942,7 @@ "source": [ "So you could devise a way to identify which is the dynamic type of your `PolymorphicVehicle` pointer and cast it dynamically to the rightful type so that extended API offered by the derived class is accessible.\n", "\n", - "If you find this clunky, you are not alone: by experience if you really need to resort to **dynamic_cast** it's probably your data architecture needs some revision. But maybe the mileage vary for other developers, and it's useful to know the possibility exist." + "If you find this clunky, you are not alone: by experience if you really need to resort to **dynamic_cast** it's probably your data architecture needs some revision. But maybe the mileage vary for other developers, and it's useful to know the possibility exists." ] }, { @@ -951,7 +951,7 @@ "source": [ "## `final` keyword\n", "\n", - "If you need to specify a class can't be derived, you may stick a `final` keyword in its declaration (from C++11 onward):\n" + "If you need to specify a class that can't be derived, you may stick a `final` keyword in its declaration (from C++11 onward):\n" ] }, { @@ -1195,7 +1195,7 @@ "source": [ "struct DerivedClass4 : public BaseClass4\n", "{\n", - " DerivedClass4() = default;; \n", + " DerivedClass4() = default;\n", " \n", " virtual std::string ClassName() const;\n", "};" @@ -1287,7 +1287,7 @@ "source": [ "struct DerivedClass5 : public BaseClass5\n", "{\n", - " DerivedClass5() = default;; \n", + " DerivedClass5() = default; \n", " \n", " virtual std::string ClassName() const;\n", "};"