Dependent Names

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.

Read more
Views: 4466

The Special Friendship of Templates

A friend has unrestricted access to the members of a class. Consequently, friendship should be given wisely. Regarding templates, friendship is special.

Read more
Views: 1498

Visiting a std::variant with the Overload Pattern

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.

Read more
Views: 3256

Smart Tricks with Parameter Packs and Fold Expressions

To complete my post about variadic templates and fold expressions, I present in this post smart tricks using parameter packs and fold expressions.

Read more
Views: 6200

From Variadic Templates to Fold Expressions

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. 

Read more
Views: 3775

More about Variadic Templates ...

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.

Read more
Views: 5024

Variadic Templates or the Power of Three Dots

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.

Read more
Views: 5669

Template Instantiation

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).

Read more
Views: 6986

Full Specialization of Function Templates

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.

Read more
Views: 4951

Template Specialization - More Details About Class Templates

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.

Read more
Views: 4604

My Newest E-Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Interactive Course: The All-in-One Guide to C++20

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 6319

Yesterday 7646

Week 39614

Month 106280

All 7374120

Currently are 176 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments