Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Range] combine, native range-for, and destructuring
From: degski (degski_at_[hidden])
Date: 2018-04-15 00:04:33


On 14 April 2018 at 17:49, degski <degski_at_[hidden]> wrote:

> On 14 April 2018 at 04:34, John M. Dlugosz via Boost-users <
> boost-users_at_[hidden]> wrote:
>
>> I want to go through two vectors at the same time, and the way to do this
>> is to "zip" the items from each into a tuple. boost::combine is a function
>> for that.
>>
>
> I've run into this problem as well, it's a real shame it doesn't work,
> because if you would be able to use boost::combine with (C++17) structured
> bindings, one can completely abstract away (if it would work) the
> zip-iterator (you wouldn't see it even though that's what's happening under
> the hood)...
>

The construct does work with std:tie, but that's at least 3 more lines of
code and does not look as "sexy" as the (not working) structured bindings
approach (sorry for the nerdy "does not look sexy" comment).

degski



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net