12 #include <boost/iterator/zip_iterator.hpp>
13 #include <boost/range.hpp>
23 template<
template<
typename,
typename>
class PairType,
typename FirstIt,
typename SecondIt>
24 using ValueType_t = PairType<typename std::iterator_traits<FirstIt>::value_type,
typename std::iterator_traits<SecondIt>::value_type>;
26 template<
template<
typename,
typename>
class PairType,
typename FirstIt,
typename SecondIt>
27 class PairIterator :
public std::iterator<std::forward_iterator_tag, ValueType_t<PairType, FirstIt, SecondIt>>
37 : IsSentinel_ {
true }
41 PairIterator (
const FirstIt& first,
const FirstIt& firstEnd,
42 const SecondIt& second,
const SecondIt& secondEnd)
43 : IsSentinel_ {
false }
45 , FirstEnd_ { firstEnd }
47 , SecondEnd_ { secondEnd }
53 return (
IsSentinel () && other.IsSentinel ()) ||
54 (First_ == other.First_ && Second_ == other.Second_);
59 return !(*
this == other);
64 return IsSentinel_ || First_ == FirstEnd_ || Second_ == SecondEnd_;
84 PairType<typename std::iterator_traits<FirstIt>::value_type,
typename std::iterator_traits<SecondIt>::value_type>
operator* ()
const
86 return { *First_, *Second_ };
90 template<
typename I1,
typename I2,
template<
typename,
typename>
class PairType>
95 template<
typename C1,
typename C2>
99 IteratorType_t { c1.begin (), c1.end (), c2.begin (), c2.end () },
107 template<
template<
typename,
typename>
class PairType = QPair,
typename C1,
typename C2>