Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
cast_itr< CASTTYPE, ITR > Class Template Reference

Cast iterator; cast the result after deferencing. More...

#include <iterator_util.h>

Public Types

using iterator_category = typename std::iterator_traits< ITR >::iterator_category
 
using difference_type = typename std::iterator_traits< ITR >::difference_type
 
using value_type = std::remove_reference_t< CASTTYPE >
 
using reference = value_type &
 
using pointer = value_type *
 

Public Member Functions

 cast_itr (void)
 empty constructor
 
 cast_itr (const ITR &itr)
 constructor
 
template<typename C , typename I >
 cast_itr (const cast_itr< C, I > &itr)
 construct from cast_itr
 
reference operator* (void) const
 cast the derefenced value to CASTYPE&
 
pointer operator-> (void) const
 cast the dereferenced value to CASTTYPE*
 
decltype(auto) raw_dereference (void) const
 dereference without casting
 
auto raw_iterator (void) const
 underlying iterator
 
comparison
bool operator== (const cast_itr &itr) const
 
bool operator!= (const cast_itr &itr) const
 
bool operator<= (const cast_itr &itr) const
 
bool operator< (const cast_itr &itr) const
 
bool operator>= (const cast_itr &itr) const
 
bool operator> (const cast_itr &itr) const
 
math operations
cast_itroperator++ (void)
 
cast_itr operator++ (int)
 
cast_itroperator+= (size_t step)
 
cast_itr operator+ (size_t step) const
 
cast_itroperator-- (void)
 
cast_itr operator-- (int)
 
cast_itroperator-= (size_t step)
 
cast_itr operator- (size_t step) const
 
difference_type operator- (const cast_itr &itr)
 
auto operator[] (size_t idx) const
 

Private Attributes

ITR _itr
 

Detailed Description

template<typename CASTTYPE, typename ITR>
requires std::input_or_output_iterator<ITR>
class bbm::cast_itr< CASTTYPE, ITR >

Cast iterator; cast the result after deferencing.

Member Typedef Documentation

◆ difference_type

using difference_type = typename std::iterator_traits<ITR>::difference_type

◆ iterator_category

using iterator_category = typename std::iterator_traits<ITR>::iterator_category

◆ pointer

using pointer = value_type*

◆ reference

◆ value_type

using value_type = std::remove_reference_t<CASTTYPE>

Constructor & Destructor Documentation

◆ cast_itr() [1/3]

cast_itr ( void  )
inline

empty constructor

◆ cast_itr() [2/3]

cast_itr ( const ITR &  itr)
inline

constructor

◆ cast_itr() [3/3]

cast_itr ( const cast_itr< C, I > &  itr)
inline

construct from cast_itr

Member Function Documentation

◆ operator!=()

bool operator!= ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator*()

reference operator* ( void  ) const
inline

cast the derefenced value to CASTYPE&

◆ operator+()

cast_itr operator+ ( size_t  step) const
inline

◆ operator++() [1/2]

cast_itr operator++ ( int  )
inline

◆ operator++() [2/2]

cast_itr & operator++ ( void  )
inline

◆ operator+=()

cast_itr & operator+= ( size_t  step)
inline

◆ operator-() [1/2]

difference_type operator- ( const cast_itr< CASTTYPE, ITR > &  itr)
inline

◆ operator-() [2/2]

cast_itr operator- ( size_t  step) const
inline

◆ operator--() [1/2]

cast_itr operator-- ( int  )
inline

◆ operator--() [2/2]

cast_itr & operator-- ( void  )
inline

◆ operator-=()

cast_itr & operator-= ( size_t  step)
inline

◆ operator->()

pointer operator-> ( void  ) const
inline

cast the dereferenced value to CASTTYPE*

◆ operator<()

bool operator< ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator<=()

bool operator<= ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator==()

bool operator== ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator>()

bool operator> ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator>=()

bool operator>= ( const cast_itr< CASTTYPE, ITR > &  itr) const
inline

◆ operator[]()

auto operator[] ( size_t  idx) const
inline

◆ raw_dereference()

decltype(auto) raw_dereference ( void  ) const
inline

dereference without casting

◆ raw_iterator()

auto raw_iterator ( void  ) const
inline

underlying iterator

Member Data Documentation

◆ _itr

ITR _itr
private

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