library of assembled shared sources

http://lass.cocamware.com

lass::stde::iterator_range< iterator_type > Class Template Reference

iterator range. More...

#include <iterator_range.h>


Public Types

typedef iterator_type iterator
typedef std::iterator_traits
< iterator_type >::pointer 
pointer
typedef std::iterator_traits
< iterator_type >::reference 
reference
typedef std::iterator_traits
< iterator_type >
::difference_type 
difference_type
typedef std::iterator_traits
< iterator_type >
::iterator_category 
iterator_category

Public Member Functions

 iterator_range ()
 empty range (sort of, read warning).
 iterator_range (iterator first, iterator last)
iterator begin () const
iterator end () const
iterator operator-> () const
reference operator* () const
reference operator[] (difference_type index) const
iterator_rangeoperator++ ()
iterator_range operator++ (int)
const difference_type size () const
const bool empty () const
const bool operator! () const
 operator const num::SafeBool () const
void swap (iterator_range &other)

Private Attributes

iterator first_
iterator last_


Detailed Description

template<typename iterator_type>
class lass::stde::iterator_range< iterator_type >

iterator range.

Author:
Bram de Greve [Bramz]

Definition at line 60 of file iterator_range.h.


Member Typedef Documentation

template<typename iterator_type >
typedef iterator_type lass::stde::iterator_range< iterator_type >::iterator

Definition at line 64 of file iterator_range.h.

template<typename iterator_type >
typedef std::iterator_traits<iterator_type>::pointer lass::stde::iterator_range< iterator_type >::pointer

Definition at line 65 of file iterator_range.h.

template<typename iterator_type >
typedef std::iterator_traits<iterator_type>::reference lass::stde::iterator_range< iterator_type >::reference

Definition at line 66 of file iterator_range.h.

template<typename iterator_type >
typedef std::iterator_traits<iterator_type>::difference_type lass::stde::iterator_range< iterator_type >::difference_type

Definition at line 67 of file iterator_range.h.

template<typename iterator_type >
typedef std::iterator_traits<iterator_type>::iterator_category lass::stde::iterator_range< iterator_type >::iterator_category

Definition at line 68 of file iterator_range.h.


Constructor & Destructor Documentation

template<typename I >
lass::stde::iterator_range< I >::iterator_range (  )  [inline]

empty range (sort of, read warning).

Warning:
Problemski: MSVC has something like _HAS_ITERATOR_DEBUGGING, which means it has the annoying habit of whenever two iterators come together (e.g. on comparison), to check whether they belong to the same container. While this makes sense in most situations, (ignoring any possible performance hit), we don't have any container when we create empty ranges. Oh, did I tell you it also checks if the iterator belongs to ANY container AT ALL?. So, even while we almost physically force first_ and last_ to be equal (think Fat Ed's super fix-it way), MSVC will bork on almost any occasion. Moral of the story: while you can _create_ default constructed ranges, DO NOT USE THEM, like EVER!

Definition at line 64 of file iterator_range.inl.

References lass::stde::iterator_range< iterator_type >::first_, and lass::stde::iterator_range< iterator_type >::last_.

template<typename I >
lass::stde::iterator_range< I >::iterator_range ( iterator  first,
iterator  last 
) [inline]

Definition at line 75 of file iterator_range.inl.


Member Function Documentation

template<typename I >
iterator_range< I >::iterator lass::stde::iterator_range< I >::begin (  )  const [inline]

template<typename I >
iterator_range< I >::iterator lass::stde::iterator_range< I >::end (  )  const [inline]

template<typename I >
iterator_range< I >::iterator lass::stde::iterator_range< I >::operator-> (  )  const [inline]

template<typename I >
iterator_range< I >::reference lass::stde::iterator_range< I >::operator* (  )  const [inline]

template<typename I >
iterator_range< I >::reference lass::stde::iterator_range< I >::operator[] ( difference_type  index  )  const [inline]

template<typename I >
iterator_range< I > & lass::stde::iterator_range< I >::operator++ (  )  [inline]

template<typename I >
iterator_range< I > lass::stde::iterator_range< I >::operator++ ( int   )  [inline]

template<typename I >
const iterator_range< I >::difference_type lass::stde::iterator_range< I >::size (  )  const [inline]

template<typename I >
const bool lass::stde::iterator_range< I >::empty (  )  const [inline]

template<typename I >
const bool lass::stde::iterator_range< I >::operator! (  )  const [inline]

template<typename I >
lass::stde::iterator_range< I >::operator const num::SafeBool (  )  const [inline]

template<typename iterator_type >
void lass::stde::iterator_range< iterator_type >::swap ( iterator_range< iterator_type > &  other  ) 


Field Documentation

template<typename iterator_type >
iterator lass::stde::iterator_range< iterator_type >::first_ [private]

template<typename iterator_type >
iterator lass::stde::iterator_range< iterator_type >::last_ [private]


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

Generated on Mon Nov 10 14:22:16 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo