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.
With fold expressions, you can implement Haskell functions foldl, foldr, foldl1, and foldr1 directly in C++. These four functions successively reduce a list to a single value.
Hunting
Today 2610
Yesterday 4371
Week 38417
Month 168542
All 12056308
Currently are 190 guests and no members online
Kubik-Rubik Joomla! Extensions
Read more...
Read more...