ModErn Text Analysis
META Enumerates Textual Applications
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
meta::util::basic_range< T >::iterator_t< Plus > Class Template Reference

Iterator to traverse the generic range. More...

#include <range.h>

Public Types

using self_type = iterator_t
 convenience typedef for the current iterator type
 
using value_type = T
 convenience typedef for the contained value of the range
 
using reference = const T &
 a reference to the contained type
 
using pointer = const T *
 a pointer to the contained type
 
using iterator_category = std::forward_iterator_tag
 the category for this iterator
 
using difference_type = std::ptrdiff_t
 the difference type for this iterator
 

Public Member Functions

self_typeoperator++ ()
 Prefix increment. More...
 
self_type operator++ (int)
 Postfix increment. More...
 
reference operator* ()
 Dereference operator. More...
 
pointer operator-> ()
 Member access operator. More...
 

Private Member Functions

 iterator_t (const basic_range< T > *range, const T &start, size_t idx)
 Constructs a new iterator. More...
 

Private Attributes

_curr
 the current value
 
size_t _idx
 the current index into the ragne
 
Plus _plus
 the functor to be used for incrementing the current value
 
const basic_range< T > * _range
 a back-pointer to the range this iterator is operating over
 

Friends

class basic_range< T >
 
bool operator== (const iterator_t &lhs, const iterator_t &rhs)
 Equality operator. More...
 
bool operator!= (const iterator_t &lhs, const iterator_t &rhs)
 Inequality operator. More...
 

Detailed Description

template<class T>
template<class Plus>
class meta::util::basic_range< T >::iterator_t< Plus >

Iterator to traverse the generic range.

Constructor & Destructor Documentation

template<class T>
template<class Plus >
meta::util::basic_range< T >::iterator_t< Plus >::iterator_t ( const basic_range< T > *  range,
const T &  start,
size_t  idx 
)
inlineprivate

Constructs a new iterator.

Parameters
rangeThe range we are iterating over
startThe start of the range
idxThe index to begin from

Member Function Documentation

template<class T>
template<class Plus >
self_type& meta::util::basic_range< T >::iterator_t< Plus >::operator++ ( )
inline

Prefix increment.

Returns
the current iterator after incrementing
template<class T>
template<class Plus >
self_type meta::util::basic_range< T >::iterator_t< Plus >::operator++ ( int  )
inline

Postfix increment.

Returns
the old iterator
template<class T>
template<class Plus >
reference meta::util::basic_range< T >::iterator_t< Plus >::operator* ( )
inline

Dereference operator.

Returns
a reference to the current value
template<class T>
template<class Plus >
pointer meta::util::basic_range< T >::iterator_t< Plus >::operator-> ( )
inline

Member access operator.

Returns
a pointer to the current value (member access)

Friends And Related Function Documentation

template<class T>
template<class Plus >
bool operator== ( const iterator_t< Plus > &  lhs,
const iterator_t< Plus > &  rhs 
)
friend

Equality operator.

Parameters
lhs
rhs
Returns
whether the two iterators are equivalent
template<class T>
template<class Plus >
bool operator!= ( const iterator_t< Plus > &  lhs,
const iterator_t< Plus > &  rhs 
)
friend

Inequality operator.

Parameters
lhs
rhs
Returns
whether the two iterators are not equivalent (defined in terms of iterator_t::operator==).

The documentation for this class was generated from the following file: