29 #ifndef CDPL_UTIL_INDEXEDELEMENTITERATOR_HPP
30 #define CDPL_UTIL_INDEXEDELEMENTITERATOR_HPP
34 #include <boost/iterator/iterator_facade.hpp>
122 template <
typename ValueType,
typename AccessFunc,
typename IndexType = std::
size_t>
124 ValueType, boost::random_access_traversal_tag>
127 typedef typename boost::iterator_facade<IndexedElementIterator<ValueType, AccessFunc, IndexType>,
129 boost::random_access_traversal_tag>::difference_type DifferenceType;
136 template <
typename ValueType2,
typename AccessFunc2,
typename IndexType2>
148 accessFunc(access_func), index(start_idx) {}
155 friend class boost::iterator_core_access;
159 void advance(DifferenceType);
161 template <
typename ValueType2,
typename AccessFunc2,
typename IndexType2>
164 template <
typename ValueType2,
typename AccessFunc2,
typename IndexType2>
167 ValueType& dereference()
const;
169 AccessFunc accessFunc;
178 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
184 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
190 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
196 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
202 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
208 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
209 template <
typename ValueType2,
typename AccessFunc2,
typename IndexType2>
210 typename CDPL::Util::IndexedElementIterator<ValueType, AccessFunc, IndexType>::DifferenceType
213 return (DifferenceType(it.index) - DifferenceType(index));
216 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
217 template <
typename ValueType2,
typename AccessFunc2,
typename IndexType2>
220 return (index == it.index && accessFunc == it.accessFunc);
223 template <
typename ValueType,
typename AccessFunc,
typename IndexType>
226 return accessFunc(index);
229 #endif // CDPL_UTIL_INDEXEDELEMENTITERATOR_HPP