diff --git a/4-Templates/1-Intro.ipynb b/4-Templates/1-Intro.ipynb index 651606c4f2360b6d191f0b8f1ac569d923f96fe2..bdbd4de80369ec9fdd7daa3bb2497c7b3fea3d95 100644 --- a/4-Templates/1-Intro.ipynb +++ b/4-Templates/1-Intro.ipynb @@ -384,10 +384,13 @@ "metadata": {}, "outputs": [], "source": [ + "#include <iostream>\n", + "\n", "{\n", " HoldAValue2 hold(9);\n", " \n", - " hold.Convert<double>();\n", + " const double converted_value = hold.Convert<double>();\n", + " std::cout << \"Value = \" << converted_value << '\\n';\n", "}" ] }, diff --git a/4-Templates/3-Syntax.ipynb b/4-Templates/3-Syntax.ipynb index 5c9d5989140f169a2a6a83e5d79232e719c1175c..b4e18b95a27ddcdbe2e2e2521c22ea3d3815af22 100644 --- a/4-Templates/3-Syntax.ipynb +++ b/4-Templates/3-Syntax.ipynb @@ -243,8 +243,7 @@ " typename T::value_type;\n", "};\n", "\n", - "template<class ContainerT>\n", - "requires HasValueType<ContainerT> \n", + "template<HasValueType ContainerT>\n", "void PrintFive()\n", "{\n", " std::cout << static_cast<typename ContainerT::value_type>(5) << std::endl;\n", diff --git a/HandsOn/3-Operators/Solution/exercise30.cpp b/HandsOn/3-Operators/Solution/exercise30.cpp index 2c2d0f48f1eac197e16cda282020bdd6c38373f7..4fd68351f0f66c48d9e760ce29782066b1691f48 100644 --- a/HandsOn/3-Operators/Solution/exercise30.cpp +++ b/HandsOn/3-Operators/Solution/exercise30.cpp @@ -64,7 +64,7 @@ public: //! Get the resolution. int GetResolution() const; - //! Pure virtual method Do(). + //! Pure virtual method - operator(). virtual void operator()(int Nbits) const = 0; //! Stupid method to silence the -Wweak-vtables warning - at least one virtual method must be defined outside the class declaration, and virtual method definition unfortunately doesn't count.