From 9282ac92777e0d3a828c408a3258e6346e545ae9 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Thu, 17 Mar 2022 15:56:06 +0100 Subject: [PATCH 1/2] fix line numbers and too long comment --- talk/objectorientation/constructors.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/talk/objectorientation/constructors.tex b/talk/objectorientation/constructors.tex index 6497cacd..42074c96 100644 --- a/talk/objectorientation/constructors.tex +++ b/talk/objectorientation/constructors.tex @@ -274,11 +274,11 @@ struct B { int a; float b; - // no constructor declared! + // no constructor }; \end{cppcode*} \end{multicols} - \begin{cppcode*}{gobble=2, firstnumber=12} + \begin{cppcode*}{gobble=2, firstnumber=13} A a{1,2}; // A::A(int, int) A a{1}; // A::A(int) A a{}; // A::A() @@ -307,11 +307,11 @@ struct B { int a; float b; - // no constructor declared! + // no constructor }; \end{cppcode*} \end{multicols} - \begin{cppcode*}{gobble=2, firstnumber=12} + \begin{cppcode*}{gobble=2, firstnumber=13} A a(1,2); // A::A(int, int) A a(1); // A::A(int) A a(); // declaration of a function ! From 492720786a2c96cf813f29c007e879c298703338 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Thu, 17 Mar 2022 15:56:47 +0100 Subject: [PATCH 2/2] rename s_nbCallsToUpper to callsToUpper --- talk/objectorientation/static.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/talk/objectorientation/static.tex b/talk/objectorientation/static.tex index 52dcf448..f4208a56 100644 --- a/talk/objectorientation/static.tex +++ b/talk/objectorientation/static.tex @@ -14,10 +14,10 @@ public: static std::string upper(std::string) {...} private: - static int s_nbCallsToUpper; // add `inline` in C++17 + static int callsToUpper; // add `inline` in C++17 }; - int Text::s_nbCallsToUpper = 0; // required before C++17 + int Text::callsToUpper = 0; // required before C++17 std::string uppers = Text::upper("my text"); - // now Text::s_nbCallsToUpper is 1 + // now Text::callsToUpper is 1 \end{cppcode} \end{frame}