Closed hageboeck closed 6 months ago
OO morning lecture:
struct
. maybe mention that a class is a struct, or that all structs are actually classes. if there is a slide, move it earlierthis
slide further back if possiblestruct
vs. class
m_
, f...
.=, etc.new
and delete
before here. there was also a question on the difference of delete
and delete[]
static
members, at least by an example. @sponce suggests to entirely move it to the advanced course. zoom questions: why can we write to the static data member if it's private? and what is the point of static? maybe add an example of a factory function.OOP:
Tools:
From JLab course:
[x] 119: what happens if I omit the the &
? -> Discuss slicing. Maybe also add a memory layout here that shows that a reference points to the start of the polymorphic object
[ ] 137: can we list all the overloadable operators?
[x] Do we still need the exercise descriptions in the slides?
137: can we list all the overloadable operators?
The original table comes from: https://en.cppreference.com/w/cpp/language/operators and does include the full list;
any of the following operators:+ - * / % ^ & \| ~ ! = < > += -= *= /= %= ^= &= \|= << >> >>= <<= == != <= >= <=> (since C++20) && \|\| ++ -- , ->* -> ( ) [ ]
make 2>&1 | more
(or less) for zsh and bash.
Add a slide on integral promotion