1 #ifndef WIRECELLUTIL_RANDOMITER 2 #define WIRECELLUTIL_RANDOMITER 4 #include <boost/iterator/iterator_categories.hpp> 5 #include <boost/iterator/iterator_facade.hpp> 9 template <
typename Container,
typename Value>
11 RandomIter<Container, Value>,
13 boost::random_access_traversal_tag
36 return this->m_index == other.
m_index;
39 typedef boost::iterator_facade<
42 boost::random_access_traversal_tag
48 void advance(
typename facade::difference_type
n)
51 if (m_index >= (
int)m_array.size() || m_index < 0) {
52 m_index = m_array.size();
66 return m_array.at(m_index);
void advance(typename facade::difference_type n)
RandomIter(bool, Container &array)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
auto array(Array const &a)
Returns a manipulator which will print the specified array.
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
boost::iterator_facade< RandomIter< Container, Value >, Value, boost::random_access_traversal_tag > facade
friend class boost::iterator_core_access
bool equal(RandomIter< Container, Value > const &other) const
Value & dereference() const
facade::difference_type distance_to(RandomIter const &other) const
RandomIter(Container &array)