cpluspluscourse icon indicating copy to clipboard operation
cpluspluscourse copied to clipboard

C++ Course Taught at CERN, from Sebastien Ponce (LHCb)

Results 72 cpluspluscourse issues
Sort by recently updated
recently updated
newest added

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...

stale

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

stale

A participant in the spring course asked about `std::complex`. I think we should at least mention it's existence.

stale

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 ?

stale

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...

stale

@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...

stale

Currently, we typeset C++ like this: ![image](https://user-images.githubusercontent.com/1224051/193472385-7f795dec-3fff-4a47-95c2-912f5cc897d9.png) And I always found it ugly that the `++` is not at half the height of the `C`. Can we fix this?

stale

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.

later
stale