Sometimes ago I have shown a real-life example reason for the existence of generic lambda, I have managed to make.
Now please consider this:
/* recursive generic lambda note: requires MSVC */ auto summa = [](auto first, auto ... second) { if constexpr (sizeof ... (second) > 0) { return first + summa(second ...); } else { return first; } };
This is not a toy. For me, this is the celebration of standard C++. But.
Make no mistake. There are still numerous people who consider this kind of code the epitome of the end of C++. They are hotly against Functional Programming (FP). And hotly against the keyword. And hotly against whatever they can think of on a given day in some forum.
I have really nothing against them, but I have to think these are the people who first jumped from the C++11/14/17 “Lunny farm” onto the (for example) D bandwagon, and then jumped of it when it turned to be a “slow train crash“.
Now they are probably considering “Rust” or “GO” or “Swift”, you name it. Until they make a full circle back to the jumping onto the standard C++ bandwagon again.
