Modern C++ Idioms
Mateusz Pusz
C++ is no longer C with classes, and it never was just an Object-Oriented language. C++ is a general-purpose programming language. It has imperative, object-oriented, and generic programming features while also providing facilities for low-level memory manipulation. If used correctly, it provides hard-to-beat performance. Such usage requires a good knowledge of C++ templates and Modern C++ Idioms, which are much different from commonly known design patterns popularized by the GoF book and invented to handle common use cases in pure OO languages like Java or C#.
What you will learn: During the workshop, we will refresh and broaden our knowledge about C++ templates and will learn Modern C++ Idioms like Niebloid, CRTP, Type Erasure, EBO, and many more. Crafting those skills will allow us to build powerful tools that are useful in the everyday work of every C++ developer.
Experience required: In order to be able to follow the workshop, you should be current with C++ and have some recent experience with writing simple C++ templates.
Environment: A laptop with a web browser and access to the Internet. All hands-on exercises will be implemented using Compiler Explorer.
- C++ Basics in a nutshell
- C++ Types
- Value Categories
- Name Lookup
- Swap
- Range-based for loop
- Special Member Functions
- Exception Safety
- C++ Templates in a nutshell
- C++ template definition
- Template parameters
- Template specialization
- Modern C++ Idioms
- Non-Movable
- RAII
- Copy-and-swap
- Smart Pointer
- type_identity
- Type Traits
- Tag dispatch
- Policy-based design
- EBO
- Type Erasure
- SOO
- Copy-on-write
- CRTP
- Barton-Nackman Trick
- Singleton
- Customization point object (Niebloid)
- Mixin