theplu::yat::utility::Range< T > Class Template Reference

A class for storing a shallow copy of a Range. More...

#include <yat/utility/Range.h>

List of all members.

Public Types

typedef T iterator_type

Public Member Functions

 Range (void)
 Default Constructor.
 Range (T first, T last)
 Constructor.
begin (void) const
end (void) const
Rangeoperator= (const Range &)
 Does not modify underlying data.

Related Functions

(Note that these are not member functions.)

template<typename T1, typename T2>
bool operator== (const Range< T1 > &, const Range< T2 > &)
 Equality comparison.
template<typename T1, typename T2>
bool operator!= (const Range< T1 > &, const Range< T2 > &)
 Based on operator==.
template<typename T1, typename T2>
bool operator< (const Range< T1 > &lhs, const Range< T2 > &rhs)
 Ordering relation.
template<typename T1, typename T2>
bool operator<= (const Range< T1 > &lhs, const Range< T2 > &rhs)
template<typename T1, typename T2>
bool operator> (const Range< T1 > &, const Range< T2 > &)
template<typename T1, typename T2>
bool operator>= (const Range< T1 > &, const Range< T2 > &)


Detailed Description

template<typename T>
class theplu::yat::utility::Range< T >

A class for storing a shallow copy of a Range.

This class can be used to create a shallow copy of range, [first, end), defined by two iterators of type T. This can be useful, for example, when creating numerous sub-ranges of a larger container.

Since:
New in yat 0.5

Member Typedef Documentation

template<typename T>
typedef T theplu::yat::utility::Range< T >::iterator_type

Iterator type T.


Member Function Documentation

template<typename T>
T theplu::yat::utility::Range< T >::begin ( void   )  const [inline]

Note:
If T is a mutable iterator, it is possible to use returned iterator to modify underlying range although this function is const.
Returns:
iterator indicating beginning of Range.

template<typename T>
T theplu::yat::utility::Range< T >::end ( void   )  const [inline]

Returns:
iterator after the Range.

template<typename T>
Range< T > & theplu::yat::utility::Range< T >::operator= ( const Range< T > &  rhs  )  [inline]

Does not modify underlying data.

This only changes this object by reassigning two iterators, begin() and end(). If you would like to modify the underlying data, use std::copy instead.


Friends And Related Function Documentation

template<typename T1, typename T2>
bool operator== ( const Range< T1 > &  ,
const Range< T2 > &   
) [related]

Equality comparison.

Returns:
true iff underlying elements are equal
Since:
New in yat 0.5

template<typename T1, typename T2>
bool operator!= ( const Range< T1 > &  ,
const Range< T2 > &   
) [related]

Based on operator==.

Since:
New in yat 0.5

template<typename T1, typename T2>
bool operator< ( const Range< T1 > &  lhs,
const Range< T2 > &  rhs 
) [related]

Ordering relation.

Using std::lexicographical_compare

Returns:
true if lhs < rhs
Since:
New in yat 0.5

template<typename T1, typename T2>
bool operator<= ( const Range< T1 > &  lhs,
const Range< T2 > &  rhs 
) [related]

Returns:
! (rhs < lhs )
Since:
New in yat 0.5

template<typename T1, typename T2>
bool operator> ( const Range< T1 > &  ,
const Range< T2 > &   
) [related]

Returns:
rhs < lhs
Since:
New in yat 0.5

template<typename T1, typename T2>
bool operator>= ( const Range< T1 > &  ,
const Range< T2 > &   
) [related]

Returns:
! (lhs < rhs )
Since:
New in yat 0.5


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

Generated on Tue Jan 18 02:21:18 2011 for yat by  doxygen 1.5.5