modern-cpp-features
modern-cpp-features copied to clipboard
A cheatsheet of modern C++ language and library features.
There is constexpr, consteval but constinit is not described. It could be worth to add it.
The ASM output will probably not be useful for beginners. It might be easier to think of the following example like having the expression `square(2)` replaced with the value `4`...
It would be great to have a brief information about modules, coroutines, and maybe three-way comparison operator.
one of the two major features: concept & module , in c++20
Hi. fallthrough example in the [section](https://github.com/AnthonyCalandra/modern-cpp-features#fallthrough-nodiscard-maybe_unused-attributes) is misleading. Look at the explanation in the [link](https://en.cppreference.com/w/cpp/language/attributes/fallthrough): > May only be applied to a [null statement](https://en.cppreference.com/w/cpp/language/statements#Expression_statements) to create a fallthrough statement ([[fallthrough]];)....
You can add std::sample which is C++17 feature.
floor(std::chrono::duration)(C++17) | converts a duration to another, rounding down(function template) -- | -- ceil(std::chrono::duration)(C++17) | converts a duration to another, rounding up(function template) round(std::chrono::duration)(C++17) | converts a duration to another,...