cpluspluscourse
cpluspluscourse copied to clipboard
C++ Course Taught at CERN, from Sebastien Ponce (LHCb)
We mention `std::unordered_map`, but never explain how to provide hash functions for your types. That is, how to specialize `std::hash`. We should add a slide on that.
Comment by a participant: "You can't see the wood for the tree" There's more templates and complications than needs to be to demonstrate moving.
There are a few mathematical utilities in C++ and a lot is upcoming. We have the standard math functions (e.g. `sin` etc), and the special math functions (#344). There is...
Not super important. But people should rather use the standard ones than write them themselves. See here: https://en.cppreference.com/w/cpp/numeric/special_functions
A participant in the spring course asked about `std::complex`. I think we should at least mention it's existence.
I dislike a little the final question (ordering complex of complex), because I suspect such "complex of complex" is a mathematical non-sense. Isn´t it ?
AFAIK, we don't discuss member function pointers (e.g. `int (S::*)(float)` would be the pointer type of `f` in `struct S{ int f(float); };`) and `operator.*`/`operator->*` anywhere. Member pointers are not...
@sponce @bernhardmgruber @hageboeck I generally recommand to make any unary constructor explicitly. Yet, in this example, how dangerous is it to let the compiler transform an int into some Fraction...
Currently, we typeset C++ like this:  And I always found it ugly that the `++` is not at half the height of the `C`. Can we fix this?
Since C++23, call operators can be declared `static`, which may lead to better generated code. Also, a lambda's `operator()` will also be declared `static` if it does not capture anything.