1 #ifndef _theplu_yat_utility_range_
2 #define _theplu_yat_utility_range_
65 Range(T first, T last) YAT_DEPRECATE_GCC_PRE4_3;
107 template<typename T1, typename T2>
108 bool operator==(const Range<T1>&, const Range<T2>&);
117 template<typename T1, typename T2>
118 bool operator!=(const Range<T1>&, const Range<T2>&);
131 template<typename T1, typename T2>
132 bool operator<(const Range<T1>& lhs, const Range<T2>& rhs);
141 template<typename T1, typename T2>
142 bool operator<=(const Range<T1>& lhs, const Range<T2>& rhs);
151 template<typename T1, typename T2>
152 bool operator>(const Range<T1>&, const Range<T2>&);
161 template<typename T1, typename T2>
162 bool operator>=(const Range<T1>&, const Range<T2>&);
167 Range<T>::Range(
void){}
171 : first_(first), last_(last)
187 first_ = rhs.
begin();
193 template<
typename T1,
typename T2>
198 T1 first1(lhs.
begin());
200 T2 first2(rhs.
begin());
202 while (first1 != last1 && first2 != last2) {
203 if (*first1 != *first2)
209 return first1==last1 && first2==last2;
213 template<
typename T1,
typename T2>
220 template<
typename T1,
typename T2>
221 bool operator<(const Range<T1>& lhs,
const Range<T2>& rhs)
223 return std::lexicographical_compare(lhs.begin(), lhs.end(),
224 rhs.begin(), rhs.end());
228 template<
typename T1,
typename T2>
235 template<
typename T1,
typename T2>
236 bool operator<=(const Range<T1>& lhs,
const Range<T2>& rhs)
242 template<
typename T1,
typename T2>
Range(void) YAT_DEPRECATE_GCC_PRE4_3
Default Constructor.
Definition: Range.h:167
#define YAT_DEPRECATE_GCC_PRE4_3
with GCC 4.3 and newer (or other compilers) define it as empty
Definition: deprecate.h:53
T end(void) const
Definition: Range.h:180
Range & operator=(const Range &)
Does not modify underlying data.
Definition: Range.h:185
A class for storing a shallow copy of a Range.
Definition: Range.h:48
bool operator!=(const Range< T1 > &, const Range< T2 > &)
Based on operator==.
Definition: Range.h:214
bool operator>(const Range< T1 > &, const Range< T2 > &)
Definition: Range.h:229
bool operator==(const Range< T1 > &, const Range< T2 > &)
Equality comparison.
Definition: Range.h:194
T begin(void) const
Definition: Range.h:175
T iterator_type
Definition: Range.h:54
bool operator>=(const Range< T1 > &, const Range< T2 > &)
Definition: Range.h:243