Contributions

Article
In the last post "Dining Philosophers Problem I", Andre Adrian started his analysis of the classical dining philosophers' problem. Today, he uses atomics, mutexes, and locks.
Article
At Christmas time, I had a few nice discussions with Andre Adrian. He solved the classical dining philosopher's problem in various ways using modern C++. I'm convinced him to write an article about this classic synchronization issue, and I'm happy to publish it in three consecutive posts.
Article
The type-traits library has two main goals: correctness and optimization. Today, I write about optimization.
Article
The two main goals of the type-traits library are very convincing: correctness and optimization. Today, I write about correctness.
Article
I finished the last article on the Type-Traits library with the challenge of explaining the std::is_base_of and std::is_convertible functions. Today I'm excited to present the answer from Mr. Helmut Zeisel.
Article
In my last post "The Type-Traits Library: Type Checks" I introduced type checks at compile time with the type-traits library. Today, I write about type comparisons at compile time
Article
The type-traits library is part of C++11 and supports type checks, type comparisons, and type modifications at compile-time. The library has more than 100 functions but grows with each new C++ standard release. Today, I present the type checks.
Article
First of all, hybrid programming is not an official term. I created it to emphasize a very interesting aspect of templates. The difference between function arguments and template arguments.
Article
In my last post "Template Metaprogramming - How it All Started", I wrote about the roots of template metaprogramming and presented the hello world of template metaprogramming: calculating the factorial of a number at compile time. In this post, I will write about, how template metaprogramming can be used to modify types at compile time.
Article
Metaprogramming is programming at compile-time. It started in C++98 with template metaprogramming, was formalized in C++11 with the type-traits library, and since C++11 has steadily improved. The main driving force is constant expressions. In this post, I want to write about its roots.
Article
I started my discussion about the "Automatic Return Type (C++98)" in my last post. Today, I'm faced with the same challenge but solve it with C++11, C++14, and C++20.
Article
Depending on the used C++ standard, there are different ways to return the right return type of a function template. In this post, I start with traits (C++98), continue in my next post with C++11/14, and end with concepts (C++20).
Article
A dependent name is essentially a name that depends on a template parameter. A dependent name can be a type, a non-type, or a template parameter. To express that a dependent name stands for a type or a template, you have to use the keywords typename or template.
Article
A friend has unrestricted access to the members of a class. Consequently, friendship should be given wisely. Regarding templates, friendship is special.
Article
Typically, you use the overload pattern for a std::variant. std::variant is a type-safe union. A std::variant (C++17) has one value from one of its types. std::visit allows you to apply a visitor to it. Exactly here comes the overload pattern very handy into play.
Article
To complete my post about variadic templates and fold expressions, I present in this post smart tricks using parameter packs and fold expressions.
Article
In my last two posts "Variadic Templates or the Power of Three Dots" and "More about Variadic Templates", I introduced variadic templates. This post goes one step further in the future and presents fold expressions that can directly reduce a parameter pack with a binary operator.
Article
In the last weeks; I learned something new about modules in C++20: private modules fragments and header units. Consequently, I make a short detour in this post and present these new features.
Article
There is a lot of power in the strange-looking three dots that are heavily used in the Standard Template Library. Today, I visualize the expansion of the three dots and show a few use cases.
Article
A variadic template is a template that can have an arbitrary number of template parameters. This feature may seem magical to you if you see it the first time. So, let me demystify variadic templates.
Article
Template instantiation is the creation of a concrete function or a concrete class out of a function template or class template. The creation of template instantiation can be implicit (compiler-generated) or explicit (user-provided).
Article
I presented in my last post "Parallel Algorithms of the STL with the GCC Compiler" the necessary theory about the C++17 algorithm. Today, I make a performance test using the Microsoft compiler and the GCC compiler to answer the simple question: Does the execution policy pay off?
Article
GCC supports my favorite C++17 feature: the parallel algorithms of the Standard Template Library (STL). I recognized this a few days ago, and I'm happy to write a post about it and share my enthusiasm.
Article
As you may know from my previous post Template Specialization, function template can only be full but not partial specialized. To make my long story short: Don't specialize function templates. Just use function overloading.
Article
After I presented in my last post Template Specialization the basics about template specialization, I dig today deeper. I want to present the partial and full specialization of a class template as a compile-time if.
Article
Templates define the behavior of families of classes or functions. Often it is required that special types or non-types may be treated special. To support this use case, you can specialize templates.
Article
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).
Article
It is quite 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).
Article
Today, I write about two topics: alias templates and template parameters. Alias templates are a way to give a name to a family of types. Template parameters can be types, non-types, and templates themselves.
Article
In my last post "Class Templates", I presented the basics about those. Today, I may surprise you with the inheritance of class templates and the instantiation of member functions of class templates.

Showing the last 30 only...