To complete my post about variadic templates and fold expressions, I present in this post smart tricks using parameter packs and 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.
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.
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.
Variadic templates are a typical feature of C++: from the users perspective they are easy to use, but from the implementor's perspective they look quite scary. Today's post is mainly about the implementor's perspective.
Currently are 198 guests and no members online
Kubik-Rubik Joomla! Extensions