yat  0.20.3pre
Public Types | Public Member Functions | Related Functions | List of all members
theplu::yat::utility::Range< T > Class Template Reference

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

#include <yat/utility/Range.h>

Public Types

typedef T iterator_type
 

Public Member Functions

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

Related Functions

(Note that these are not member functions.)

template<typename T1 , typename T2 >
bool operator== (const Range< T1 > &, const Range< T2 > &)
 Equality comparison. More...
 
template<typename T1 , typename T2 >
bool operator!= (const Range< T1 > &, const Range< T2 > &)
 Based on operator==. More...
 
template<typename T1 , typename T2 >
bool operator< (const Range< T1 > &lhs, const Range< T2 > &rhs)
 Ordering relation. More...
 
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
Deprecated:
Provided for backward compatibility with the 0.12 API. Use Boost Range class instead, which provides a more extensive interface.

Member Typedef Documentation

◆ iterator_type

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

Iterator type T.

Member Function Documentation

◆ begin()

template<typename T >
T theplu::yat::utility::Range< T >::begin ( void  ) const
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.

◆ end()

template<typename T >
T theplu::yat::utility::Range< T >::end ( void  ) const
Returns
iterator after the Range.

◆ operator=()

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

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

◆ operator!=()

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

Based on operator==.

Since
New in yat 0.5

◆ operator<()

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

◆ operator<=()

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

◆ operator==()

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

◆ operator>()

template<typename T1 , typename T2 >
bool operator> ( const Range< T1 > &  ,
const Range< T2 > &   
)
related
Returns
rhs < lhs
Since
New in yat 0.5

◆ operator>=()

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 Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14