Classes | Namespaces | Functions | Variables
RangeForWrapper.h File Reference

Utility function to enable range-for on different type iterators. More...

#include "boost/variant.hpp"
#include <stdexcept>
#include <utility>
#include <iterator>
#include <type_traits>

Go to the source code of this file.

Classes

class  util::details::RangeForWrapperIterator< BeginIter, EndIter >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Dereferencer
 Visitor to dereference an iterator. More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Dereferencer::DereferencerImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::MemberAccessor
 Visitor to access a data member of the pointed class. More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::MemberAccessor::MemberAccessorImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Incrementer
 Visitor to increment an iterator. More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Incrementer::IncrementerImpl< Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Decrementer
 Visitor to decrement an iterator. More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Decrementer::DecrementerImpl< Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Comparer
 Visitor to compare iterators (returns whether they differ). More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Comparer::ComparerImpl< A, B, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::IndexAccessor
 Visitor to access element by index. More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::IndexAccessor::IndexAccessorImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Difference
 Visitor to compare iterators (returns whether they differ). More...
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Difference::DifferenceImpl< A, B, typename >
 
struct  util::details::RangeForWrapperTraits< RangeRef >
 Class defining types and traits for RangeForWrapperBox. More...
 
class  util::details::RangeForWrapperBox< RangeRef >
 Class offering begin/end iterators of the same type out of a range of iterators of different types. More...
 
struct  util::details::RangeForWrapperBox< RangeRef >::DataBox
 
struct  util::details::SameIterTag
 Tag for internal use. More...
 
struct  util::details::DiffIterTag
 Tag for internal use. More...
 
struct  util::details::WrapRangeForDispatcher< BaseRange, SameIteratorsType >
 
struct  util::details::WrapRangeForDispatcher< BaseRange, true >
 
struct  util::details::WrapRangeForDispatcher< BaseRange, false >
 
struct  util::RangeForWrapperTag
 Tag marking the use of RangeForWrapperBox. More...
 
struct  util::details::is_type< T >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Comparer::ComparerImpl< A, B, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Comparer::ComparerImpl< A, B, std::enable_if_t< std::is_convertible< decltype(std::declval< A >()!=std::declval< B >()), bool >::value > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Dereferencer::DereferencerImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Dereferencer::DereferencerImpl< Result, Iter, std::enable_if_t< is_type_v< decltype(*(std::declval< Iter >()))> > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::MemberAccessor::MemberAccessorImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::MemberAccessor::declval< Iter >().operator->())> > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Incrementer::IncrementerImpl< Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Incrementer::IncrementerImpl< Iter, std::enable_if_t< is_type_v< decltype(++(std::declval< Iter >()))> > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Decrementer::DecrementerImpl< Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Decrementer::DecrementerImpl< Iter, std::enable_if_t< is_type_v< decltype(--(std::declval< Iter >()))> > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::IndexAccessor::IndexAccessorImpl< Result, Iter, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::IndexAccessor::IndexAccessorImpl< Result, Iter, std::enable_if_t< is_type_v< decltype((std::declval< Iter >())[0])> > >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Difference::DifferenceImpl< A, B, typename >
 
struct  util::details::RangeForWrapperIterator< BeginIter, EndIter >::Difference::DifferenceImpl< A, B, std::enable_if_t< std::is_convertible< decltype(std::declval< A >()-std::declval< B >()), RangeForWrapperIterator< BeginIter, EndIter >::difference_type >::value > >
 

Namespaces

 util
 Namespace for general, non-LArSoft-specific utilities.
 
 util::details
 

Functions

template<typename Range >
auto util::wrapRangeFor (Range &&range) -> decltype(auto)
 Wraps an object for use in a range-for loop. More...
 
template<typename Range >
auto util::operator| (Range &&range, RangeForWrapperTag) -> decltype(auto)
 Transforms a range so that it can be used in a range-for loop. More...
 

Variables

constexpr RangeForWrapperTag util::range_for
 
template<typename T >
constexpr bool util::details::is_type_v = is_type<T>()
 

Detailed Description

Utility function to enable range-for on different type iterators.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)
Date
December 12, 2016

This header will be needed likely until C++20, since range library is not providing some definitions that are needed for range for loops.

Definition in file RangeForWrapper.h.