ryanhaining / cppitertools

Implementation of python itertools and builtin iteration functions for C++17
https://twitter.com/cppitertools
BSD 2-Clause "Simplified" License
1.37k stars 115 forks source link

compare const and non-const chained iterators #103

Closed reach2sayan closed 6 months ago

reach2sayan commented 7 months ago

There is new struct called IteratorDataPair templated on 2 tuple-like types. This enables binary operations to have different tuple-like types.

check_end_and_adjust() effectively is a unary operation, but we can simply pass the same type twice.

Also I just friended any Iterator<T> with another Iterator<K> for easy access to index_

ryanhaining commented 6 months ago

Thanks for this. I've got a couple busy days in front of me but will try to give it a good look this weekend. In the meantime, please use clang-format on the files you modified (clang-format -i --style=file chain.hpp and same for test_chain.cpp) and amend+force push to update the PR. Otherwise I gotta do it after submission which overwrites your contributions in the blame layer if there's nothing else for me to change.

ryanhaining commented 6 months ago

Great, thanks a lot for doing this