Modern C++: When Efficiency Matters [2020 class archive]

Modern C++: When Efficiency Matters is a three-day online training course with programming exercises taught by Andreas Fertig. It is offered online from 11AM to 5PM Eastern Time (EDT),  Wednesday September 9th through Friday September 11th, 2020 (before the conference).

Course Description

Despite that we live in a time in which computers have more and more resources there are still systems which are constraint in memory, CPU or other hardware.

To get good code even for such projects it helps to know how certain features in C++ work. In this class we talk about the new features since C++11 and how they translate to code.

This gives you a good understanding of what each feature costs. We do so by using C++ Insights (cppinsights.io) and Compiler Explorer (godbolt.org)to peak into the world of the compiler.

Aside from controlling the resulting code, we will also look to implement things with less code, this helps to save the human resource when it comes to maintenance and debugging.

In case, we have time at the end, we will have a brief look behind coroutines from C++20.

Prerequisites

Students are expected to have a basic knowledge of C++ (at least 98 with a basic understanding of C++11).

Course Topics

  • Compile-time vs. run-time
  • Type-deduction surprises
  • Range-based for-loops
  • noexcept
  • What is a std::initializer_list
  • Narrow the variable scope: if / switch with initialization
  • Constructor inheritance and its trap
  • In-class member initialization
  • Lambdas: Generic as well as templated (a preview into C++20)
  • Lambda captures: Know what will be captured
  • Structured bindings
  • Variadic templates
  • Recursive variadic templates vs. fold-expressions
  • CTAD (Class template argument deduction)
  • How a local non-trivial `static` variable works
  • Move-semantics
  • Know the costs of the abstraction: shared-/unique-ptr
  • coroutines

Course Instructor

Andreas Fertig

Andreas Fertig is an independent trainer and consultant for C++ specializing in embedded systems. Since his computer science studies in Karlsruhe, he has dealt with embedded systems and the associated requirements and peculiarities. He worked for about 10 years for Philips Medizin Systeme GmbH as a C++ software developer and architect with focus on embedded systems.He also develops macOS applications and is the creator of cppinsights.io.