Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RRangeCast< T, isDynamic, Range_t > Class Template Reference

template<typename T, bool isDynamic, typename Range_t>
class ROOT::RRangeCast< T, isDynamic, Range_t >

Wraps any collection that can be used in range-based loops and applies static_cast<T> or dynamic_cast<T> to each element.

Template Parameters
TThe new type to convert to.
isDynamicIf true, dynamic_cast is used, otherwise static_cast is used.
Range_tThe type of the input range, which should be usually a reference type to avoid copying.

Definition at line 135 of file RRangeCast.hxx.

Public Types

using const_iterator = Internal::TypedIter< T, decltype(std::cbegin(std::declval< Range_t >())), isDynamic >
 
using iterator = Internal::TypedIter< T, decltype(std::begin(std::declval< Range_t >())), isDynamic >
 

Public Member Functions

 RRangeCast (Range_t &&inputRange)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Private Attributes

Range_t fInputRange
 

#include <ROOT/RRangeCast.hxx>

Inheritance diagram for ROOT::RRangeCast< T, isDynamic, Range_t >:
[legend]

Member Typedef Documentation

◆ const_iterator

template<typename T , bool isDynamic, typename Range_t >
using ROOT::RRangeCast< T, isDynamic, Range_t >::const_iterator = Internal::TypedIter<T, decltype(std::cbegin(std::declval<Range_t>())), isDynamic>

Definition at line 144 of file RRangeCast.hxx.

◆ iterator

template<typename T , bool isDynamic, typename Range_t >
using ROOT::RRangeCast< T, isDynamic, Range_t >::iterator = Internal::TypedIter<T, decltype(std::begin(std::declval<Range_t>())), isDynamic>

Definition at line 148 of file RRangeCast.hxx.

Constructor & Destructor Documentation

◆ RRangeCast()

template<typename T , bool isDynamic, typename Range_t >
ROOT::RRangeCast< T, isDynamic, Range_t >::RRangeCast ( Range_t &&  inputRange)
inline

Definition at line 138 of file RRangeCast.hxx.

Member Function Documentation

◆ begin() [1/2]

template<typename T , bool isDynamic, typename Range_t >
iterator ROOT::RRangeCast< T, isDynamic, Range_t >::begin ( )
inline

Definition at line 149 of file RRangeCast.hxx.

◆ begin() [2/2]

template<typename T , bool isDynamic, typename Range_t >
const_iterator ROOT::RRangeCast< T, isDynamic, Range_t >::begin ( ) const
inline

Definition at line 145 of file RRangeCast.hxx.

◆ end() [1/2]

template<typename T , bool isDynamic, typename Range_t >
iterator ROOT::RRangeCast< T, isDynamic, Range_t >::end ( )
inline

Definition at line 150 of file RRangeCast.hxx.

◆ end() [2/2]

template<typename T , bool isDynamic, typename Range_t >
const_iterator ROOT::RRangeCast< T, isDynamic, Range_t >::end ( ) const
inline

Definition at line 146 of file RRangeCast.hxx.

Member Data Documentation

◆ fInputRange

template<typename T , bool isDynamic, typename Range_t >
Range_t ROOT::RRangeCast< T, isDynamic, Range_t >::fInputRange
private

Definition at line 153 of file RRangeCast.hxx.

  • core/foundation/inc/ROOT/RRangeCast.hxx