12 Jun
2014
12 Jun
'14
9:44 p.m.
On 06/07/2014 06:37 AM, Peter Dimov wrote:
Louis Dionne wrote:
Here's the idea:
auto list = [](auto ...xs) { return [=](auto access) { return access(xs...); }; };
auto head = [](auto xs) { return xs([](auto first, auto ...rest) { return first; }); };
That's very clever.
It's also a good example of how C++ continues to acquire expressive power and surprise us after 16 years of being an ISO standard.
Agreed. I love it. And since C++14 lambdas support move capture, this can do perfect forwarding, too. \e