iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::IteratorRange< IteratorType > Class Template Reference

#include <nrt/Core/Design/IteratorRange.H>

template<class IteratorType>
class nrt::IteratorRange< IteratorType >

A rudimentary implementation of an iterator range.

Iterator ranges are a currently under discussion addition to C++, which can be followed here in detail: http://www.open-std.org/mailman/listinfo/ranges.

Two example implementations can be found at https://github.com/marcinz/libcxx-ranges and http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/range.h?view=markup.

This range class presented here is a lightweight wrapper for two iterators that offers easy use with range based for loops introduced in C++11.

Template Parameters
IteratorTypeThe type of the iterator to wrap up

Definition at line 52 of file IteratorRange.H.

Public Types

typedef std::iterator_traits
< IteratorType >
::iterator_category 
iterator_category
 
typedef std::iterator_traits
< IteratorType >::value_type 
value_type
 
typedef std::iterator_traits
< IteratorType >
::difference_type 
difference_type
 
typedef std::iterator_traits
< IteratorType >::reference 
reference
 
typedef std::iterator_traits
< IteratorType >::pointer 
pointer
 

Public Member Functions

 IteratorRange ()
 Create an empty, likely invalid range.
 
 IteratorRange (IteratorType &&begin, IteratorType &&end)
 Create a range from two iterators.
 
 IteratorRange (IteratorRange const &other)=default
 Copy construction.
 
 IteratorRange (IteratorRange &&other)=default
 Move construction.
 
IteratorRangeoperator= (IteratorRange const &other)=default
 Copy assignment.
 
IteratorRangeoperator= (IteratorRange &&other)=default
 Move assignment.
 
IteratorType begin () const
 Get the begin iterator.
 
IteratorType end () const
 Get the end iterator.
 

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