C++: News Until C++20 (2 Days)

Training Goal/Style

The audience consists of professional programmers who are not new to C++. As such, rather than reinforcing each topic through exercises, it is more important to discuss matters and to develop a common knowledge and a common sense.

Throughout the training, the presentation style will be live-coding-by-trainer, only falling back to a traditional frontal presentation style where applicable. The audience will be left with a screenplay-like writeup, much like this one.

Topics

The following list of topics is the outcome of a “pre-sales” talk with the customer, for a two-days on-site C++ training. The list is largely unordered (yet), and adaptations to it are likely to be made.

  • Brace initialization (here)

  • RValue References, and Move Semantics (here). Primarily, show the usage of moving.

    • What the compiler knows/does

    • Relation with RVO

    • Using std::move()

    • Rule of 5 (as opposed to “3” before rvalue references were invented)

    • = delete, = default

    • Non-relation to perfect forwarding ( here)

  • Container and algorithms overview (here). Show hash-table based data structures std::unordered_set<> and std::unordered_map<> [2].

  • Structured Binding (here). Discuss usage of std::tuple<>.

  • constexpr (here) [1]

  • Multithreading (here). OpenMP is used by the custumer, so the problem appears to be solved. It might not hurt, though, to know what a race condition is, and how to protect against it.

  • Smart pointers: std::shared_ptr<> vs. std::unique_ptr<> (here). Probably show the RValue References/Move Semantics topic in the light of understanding compiler error messages when using std::unique_ptr<> incorrectly.

  • std::array<> [2]

  • std::span<> [2]

  • Ranges and views (here)

  • std::any (here), std::variant<> (here). Show usage, and discuss.

  • The “spaceship” operator [2]

  • std::fmt (vs printf()) [2]

  • std::filesystem (here). In addition to basic functionality, show how to handle UTF-8 encoded paths (std::filesystem::u8path) [2]

  • Deducing this (C++23) [2]

  • Execution policies of parallel algorithms [2]

Footnotes