Chaining iterators for C++

前端 未结 7 2059
野性不改
野性不改 2020-12-01 12:24

Python\'s itertools implement a chain iterator which essentially concatenates a number of different iterators to provide everything from single iterator.

Is there so

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 12:26

    Not in the standard library. Boost might have something.

    But really, such a thing should be trivial to implement. Just make yourself an iterator with a vector of iterators as a member. Some very simple code for operator++, and you're there.

提交回复
热议问题