29 #ifndef LARCORE_COREUTILS_DEREFERENCEITERATOR_H 30 #define LARCORE_COREUTILS_DEREFERENCEITERATOR_H 34 #include <type_traits> 42 template <
typename BeginIter,
typename EndIter>
50 BeginIter
const&
begin()
const {
return b; }
51 EndIter
const&
end()
const {
return e; }
55 template <
typename BeginIter,
typename EndIter>
62 template <
typename Iter,
typename Value>
78 using pointer = std::add_pointer_t<value_type>;
79 using reference = std::add_lvalue_reference_t<value_type>;
99 template <
typename OtherIter,
typename OtherValue>
105 "Copying from a iterator with incompatible value" 112 template <
typename OtherIter,
typename OtherValue>
118 "Moving from a iterator with incompatible value" 147 {
return { iter + offset }; }
149 {
return { iter - offset }; }
152 { iter += offset;
return *
this; }
154 { iter -= offset;
return *
this; }
160 {
return iter - other.
iter; }
169 {
return other.
iter == iter; }
171 {
return other.
iter != iter; }
173 {
return other.
iter <= iter; }
175 {
return other.
iter >= iter; }
177 {
return other.
iter < iter; }
179 {
return other.
iter < iter; }
186 template <
typename Iter,
typename Value>
191 {
return iter + offset; }
216 template <
typename Iter>
219 std::add_const_t<std::decay_t<decltype(**(std::declval<Iter>()))>>
233 template <
typename Iter>
236 std::decay_t<decltype(**(std::declval<Iter>()))>
254 template <
typename Iter>
268 template <
typename Cont>
282 template <
typename Cont>
296 template <
typename Cont>
310 template <
typename Cont>
339 template <
typename Cont>
375 template <
typename Cont>
389 template <
typename Iter>
394 template <
typename Cont>
399 template <
typename Cont>
404 template <
typename Cont>
409 template <
typename Cont>
435 template <
typename Cont>
471 template <
typename Cont>
484 #endif // LARCORE_COREUTILS_DEREFERENCEITERATOR_H typename iterator_t::difference_type difference_type
auto operator+(typename DereferenceIteratorBase< Iter, Value >::difference_type offset, DereferenceIteratorBase< Iter, Value > const &iter)
Swapped addition operator.
auto crbeginDereferenceIterator(Cont &cont)
Namespace for general, non-LArSoft-specific utilities.
auto crendDereferenceIterator(Cont &cont)
DereferenceIteratorBase(Iter const &iter, initialize_tag)
Constructor: copies the specified iterator in.
bool operator>(ScheduleID const left, ScheduleID const right) noexcept
DoubleProduct & operator+=(DoubleProduct &left, DoubleProduct const &right)
iterator_t iter
wrapper iterator
BeginIter const & begin() const
auto dereferenceConstIteratorLoop(Cont &cont)
Returns an object enabling a dereferencing range-for loop.
auto dereferenceIteratorLoop(Cont &cont)
Returns an object enabling a dereferencing range-for loop.
EndIter const & end() const
auto rendDereferenceIterator(Cont &cont)
Returns a dereference reverse iterator to the end of container.
auto dereferenceIteratorReverseLoop(Cont &cont)
Returns an object enabling a dereferencing reverse range-for loop.
auto beginDereferenceIterator(Cont &cont)
Returns a dereference iterator to the begin of specified container.
this_t & operator++()
Prefix increment operator.
Base class for dereferencing iterators.
auto makeIteratorBox(BeginIter b, EndIter e)
bool operator!=(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
QuadExpr operator-(double v, const QuadExpr &e)
bool operator<(ProductInfo const &a, ProductInfo const &b)
std::add_lvalue_reference_t< value_type > reference
bool operator<=(ScheduleID const left, ScheduleID const right) noexcept
std::add_pointer_t< value_type > pointer
auto makeDereferenceConstIterator(Iter &&iter)
this_t & operator--()
Prefix decrement operator.
auto makeDereferenceIterator(Iter &&iter)
Returns a dereference iterator to the begin of specified container.
Iter iterator_t
wrapped iterator type
typename iterator_t::iterator_category iterator_category
bool is_null() const
Bonus: returns true if the pointer is not dereferentiable.
auto dereferenceConstIteratorReverseLoop(Cont &cont)
Returns an object enabling a dereferencing reverse range-for loop.
auto rbeginDereferenceIterator(Cont &cont)
Returns a dereference reverse iterator to the begin of container.
this_t operator--(int)
Postfix decrement operator.
DereferenceIteratorBase(Iter &&iter, initialize_tag)
Constructor: acquires the specified iterator.
LArSoft-specific namespace.
bool operator>=(ScheduleID const left, ScheduleID const right) noexcept
auto cendDereferenceIterator(Cont &cont)
Tag used for initialization.
auto cbeginDereferenceIterator(Cont &cont)
QuadExpr operator*(double v, const QuadExpr &e)
this_t operator++(int)
Postfix increment operator.
auto endDereferenceIterator(Cont &cont)
Returns a dereference iterator to the end of specified container.
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
IteratorBox(BeginIter b, EndIter e)