12 #ifndef HAMMER_TOOLS_ITERATORS
13 #define HAMMER_TOOLS_ITERATORS
17 #include <type_traits>
21 template <
typename OuterIterator,
typename InnerIterator>
28 using outer_category =
typename std::iterator_traits<outer_iterator>::iterator_category;
29 using inner_category =
typename std::iterator_traits<inner_iterator>::iterator_category;
30 using common_category =
typename std::common_type<outer_category, inner_category>::type;
33 typename std::conditional<std::is_same<common_category, std::random_access_iterator_tag>::value,
38 using value_type =
typename std::pair<outer_value_type, outer_value_type>;
42 using inner_pointer =
typename std::iterator_traits<inner_iterator>::pointer;
43 using outer_pointer =
typename std::iterator_traits<outer_iterator>::pointer;
44 using pointer =
typename std::pair<outer_pointer, inner_pointer>;
45 using reference =
typename std::pair<outer_reference, inner_reference>;
typename std::common_type< outer_category, inner_category >::type common_category
inner_iterator inner_begin_
product_iterator(outer_iterator out_begin, outer_iterator out_end, inner_iterator in_begin, inner_iterator in_end)
typename std::iterator_traits< inner_iterator >::iterator_category inner_category
typename std::iterator_traits< inner_iterator >::reference inner_reference
outer_iterator outer_end_
typename std::pair< outer_value_type, outer_value_type > value_type
OuterIterator outer_iterator
typename std::iterator_traits< outer_iterator >::value_type outer_value_type
product_iterator & operator--()
inner_iterator inner_end_
product_iterator(outer_iterator out_it, outer_iterator out_begin, outer_iterator out_end, inner_iterator in_it, inner_iterator in_begin, inner_iterator in_end)
typename std::iterator_traits< outer_iterator >::reference outer_reference
outer_iterator outer_begin_
typename std::iterator_traits< outer_iterator >::iterator_category outer_category
InnerIterator inner_iterator
typename std::iterator_traits< outer_iterator >::pointer outer_pointer
typename std::pair< outer_reference, inner_reference > reference
product_iterator operator++(int)
product_iterator & operator++()
friend bool operator==(const product_iterator &a, const product_iterator &b)
typename std::iterator_traits< inner_iterator >::value_type inner_value_type
product_iterator operator--(int)
pointer operator->() const
friend bool operator!=(const product_iterator &a, const product_iterator &b)
typename std::pair< outer_pointer, inner_pointer > pointer
typename std::iterator_traits< inner_iterator >::pointer inner_pointer
typename std::conditional< std::is_same< common_category, std::random_access_iterator_tag >::value, std::bidirectional_iterator_tag, common_category >::type iterator_category
reference operator*() const