Boost logo

Boost :

Subject: Re: [boost] Efficient tuple implementation
From: Eric Niebler (eniebler_at_[hidden])
Date: 2014-06-12 17:44:28


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk