Entries by Rainer Grimm

Template Specialization

Templates define the behavior of families of classes or functions. Often it is required that particular types or non-types may be treated special. To support this use case, you can specialize templates.

Template Argument Deduction of Class Templates

In my last post, Template Arguments, I wrote about function template type deduction (C++98) and auto type deduction (C++11). Today I wear more modern hats. I start with automatic type deduction of non-type template parameters and class templates (C++17) and finish with automatic type deduction of concepts (C++20).

Template Arguments

It is pretty interesting how the compiler deduces the types for the template arguments. To make it short, you get most of the time the type you expect. The rules do not only apply to function templates (C++98) but also to auto (C++11), to class templates (C++17), and concepts (C++20).

“Concurrency with Modern C++” Update to C++20

I am happy to announce. I updated my “Concurrency with Modern C++” book to C++20. This update includes a restructuring of the book and more than 50 pages and runnable examples. Now, you get about 650 pages of concurrency in C++ and nearly 200 runnable examples. Here is more info: https://leanpub.com/concurrencywithmodernc