Lumiera  0.pre.03
»edit your freedom«
RangeIter< IT > Class Template Reference

#include "lib/iter-adapter.hpp"

Description

template<class IT>
class lib::RangeIter< IT >

Accessing a STL element range through a Lumiera forward iterator, An instance of this iterator adapter is completely self-contained and allows to iterate once over the range of elements, until pos==end.

Thus, a custom container may expose a range of elements of an embedded STL container, without controlling the details of the iteration (as is possible using the more generic IterAdapter).

Note
  • when IT is just a pointer, we use the pointee as value type
  • but when IT is a class, we expect the usual STL style nested typedefs value_type, reference and pointer

Definition at line 713 of file iter-adapter.hpp.

Public Types

using pointer = typename _ValTrait::pointer
 
using reference = typename _ValTrait::reference
 
using value_type = typename std::remove_reference< reference >::type
 

Public Member Functions

 RangeIter (IT const &start, IT const &end)
 
template<class I2 >
 RangeIter (I2 const &oIter)
 allow copy, when the underlying iterators are compatible or convertible
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (RangeIter)
 
const IT & getEnd () const
 
const IT & getPos () const
 access wrapped STL iterator
 
bool isValid () const
 
 operator bool () const
 
reference operator* () const
 
RangeIteroperator++ ()
 
pointer operator-> () const
 

Private Types

using _ValTrait = meta::ValueTypeBinding< meta::remove_pointer_t< IT > >
 

Private Member Functions

void _maybe_throw () const
 

Private Attributes

IT e_
 
IT p_
 

Member Typedef Documentation

◆ value_type

using value_type = typename std::remove_reference<reference>::type
Note
special twist, since a STL const_iterator would yield a non-const value_type

Definition at line 725 of file iter-adapter.hpp.

+ Inheritance diagram for RangeIter< IT >:
+ Collaboration diagram for RangeIter< IT >:

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