cppitertools icon indicating copy to clipboard operation
cppitertools copied to clipboard

request zip/zip_longest functionality

Open ghost opened this issue 5 years ago • 2 comments

Hi, good to see more Python like functions in c++.

Is it possible to have zip and zip_longest use a single iterator over an arbitrary number of containers that are only known at runtime? Just like in Python when unpacking a list of lists? It would really be helpful for me.

ghost avatar Jan 25 '20 13:01 ghost

I've been thinking about how to go about this and can't come up with a great way to deal with references other than std::reference_wrapper. That's likely what I'll end up using.

ryanhaining avatar Feb 21 '20 01:02 ryanhaining

Nice. But euh, why do you hesitate using such an approach?

ghost avatar Feb 21 '20 13:02 ghost