Contributions

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.
Article
A function template represents a family of functions. Accordingly, a class template represents a family of classes. Today, I want to introduce class templates.
Article
In the last post "Function Templates", I wrote about the overloading of function templates and automatically deducing the return type of a function template. Today, I dive deeper and specify explicitly the template arguments of a function template and bring concepts into the play.
Article
A function template is a family of functions. In this post, I want to dive deeper into function templates.
Article
The idea of this post is quite simple. I want to visualize templates and, in particular, the process of template instantiation. Thanks to C++ Insights, this visualization is pretty easy.
Article
The future of C++ speaks templates, and so does my blog Modernes C++. Based on the poll of my last post "Quo Vadis - Modernes C++", my next presumably 50 - 100 posts explain the details to templates. In this post, I want to give you an idea of the upcoming posts.
Article
DONE: I have written almost 100 posts about C++20. Now, I want to ask you the question: What should be my next big topic? Make your choice in this poll.

Now, let me take about the future of Modernes C++. I have three ideas in my mind: C++23, extending and embedding Python with C/C++, and templates. The poll is open for one week including the 24.04. This means, in my next post I present your favorite and my plan to write about it.
Article
In my last post "Starting Jobs with Coroutines", I applied co_await to start a job. In this post, I improve the workflow and automatically resume a job if necessary. In my final step, I resume the job on a separate thread.
Article
C++20 has three new keywords to make a coroutine out of a function: co_return, co_yield, and co_await. co_await requires an Awaitable as arguments and starts the Awaiter workflow. Let me show in this post, what that means.
Article
In my last post in this mini-series to coroutines from the practical perspective, I presented the workflow of "An Infinite Data Stream with Coroutines in C++20". In this post, I use the generic potential of the data stream.
Article
In this post, I analyze the new keyword co_yield. Thanks to co_yield, you can create an infinite data stream in C++20.
Article
This post concludes my posts about co_return in C++20. I started with an eager future, continued with a lazy future. Today, I execute the future in a separate thread using coroutines as an implementation detail.

Showing the last 30 only...