header files in C++
the whole class has to be in the header file (including implementation of the member functions, even private members)
when using const
and pointers together, it might get complicated
the behavior will differ based on the const
keyword position
function declaration vs. definition
std::string
references
T &
used as an output parameterconst T &
used as an input parameterT &&
used to steal from themresolution of the overloaded function depends on the number and types of the arguments
or, for member functions, it depends on the type of the object (whether it's modifiable or not)
invalidations in containers
using virtual functions
Derived d; Base b = d;
b
would be an instance of the Base class, it would contain only a subset of the data members of d
virtual inheritance
forwarding (universal) references
auto&&
variable typeT&&
std::forward<T>(x)
T&&
variadic templates
template<typename... TList> void f(TList&&... plist) { g(std::forward<TList>(plist)...); }