1 #ifndef _theplu_yat_utility_range_ 2 #define _theplu_yat_utility_range_ 107 template<
typename T1,
typename T2>
117 template<
typename T1,
typename 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>
161 template<
typename T1,
typename T2>
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>
The Department of Theoretical Physics namespace as we define it.
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
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
T begin(void) const
Definition: Range.h:175
bool operator==(const Range< T1 > &, const Range< T2 > &)
Equality comparison.
Definition: Range.h:194
T end(void) const
Definition: Range.h:180
T iterator_type
Definition: Range.h:54
bool operator>=(const Range< T1 > &, const Range< T2 > &)
Definition: Range.h:243