Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions talk/objectorientation/constructors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 !
Expand Down
6 changes: 3 additions & 3 deletions talk/objectorientation/static.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}