From 8ab482f49c81e10c675a87193ee3b9d994140f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gilles?= <sebastien.gilles@inria.fr> Date: Mon, 10 May 2021 10:58:00 +0200 Subject: [PATCH] Report some typos from docker run -p 8888:8888 -it -e DISPLAY=:0 -v /tmp/.X11-unix:/tmp/.X11-unix -v /Users/sebastien/Documents/Formations/GettingStartedCpp:/home/non_root_user/Formation/Cpp --cap-drop=all formation_cpp:latest (they were 'lost' follwoing the splitting of one notebook in half). --- 2-ObjectProgramming/6-inheritance.ipynb | 6 +++--- 2-ObjectProgramming/7-polymorphism.ipynb | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/2-ObjectProgramming/6-inheritance.ipynb b/2-ObjectProgramming/6-inheritance.ipynb index 3e17b33..ea13477 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 0a8362e..e87af28 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", "};" -- GitLab