Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2019-12-06 16:40:03


On 2019-12-06 18:09, Mathias Gaunard via Boost wrote:
> On Fri, 6 Dec 2019, 14:44 Andres Llopis, <allopis_at_[hidden]> wrote:
>
>>> zip_iterator works with fusion sequences.
>>> Make sure you include boost/fusion/adapted/std_tuple.hpp
>>>
>>> Also std::get<N>(x), not x.get<N>().
>>
>> Thanks Mathias, including fusion adapted std tuple kind of works, only
>> remaining issue is that I cannot use the std::get<> overloads with a type
>> instead of an int:
>>
>> https://godbolt.org/z/wGJCp-
>>
>> What could be the problem?
>
> Tuples do not support this operation; conceptually it makes no sense.

They do, since C++14, but only if the type is specified exactly once in
the list of types in the tuple.

The problem seems to be that the tuple returned by zip_iterator contains
references returned after dereferencing the adopted iterators, and you
are trying to get a value. Getting references works:

https://godbolt.org/z/rdVQGb


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