- Timestamp:
- Jun 12, 2008, 8:51:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/Range.h
r1339 r1340 169 169 170 170 171 template<typename T >172 bool operator==(const Range<T >& lhs, const Range<T>& rhs)171 template<typename T1, typename T2> 172 bool operator==(const Range<T1>& lhs, const Range<T2>& rhs) 173 173 { 174 174 // we are not using std::equal because we want to handle ranges of 175 175 // different length 176 T first1(lhs.begin());177 T last1(lhs.end());178 T first2(rhs.begin());179 T last2(rhs.end());176 T1 first1(lhs.begin()); 177 T1 last1(lhs.end()); 178 T2 first2(rhs.begin()); 179 T2 last2(rhs.end()); 180 180 while (first1 != last1 && first2 != last2) { 181 181 if (*first1 != *first2) … … 189 189 190 190 191 template<typename T >192 bool operator!=(const Range<T >& lhs, const Range<T>& rhs)191 template<typename T1, typename T2> 192 bool operator!=(const Range<T1>& lhs, const Range<T2>& rhs) 193 193 { 194 194 return ! (lhs==rhs); … … 196 196 197 197 198 template<typename T >199 bool operator<(const Range<T >& lhs, const Range<T>& rhs)198 template<typename T1, typename T2> 199 bool operator<(const Range<T1>& lhs, const Range<T2>& rhs) 200 200 { 201 201 return std::lexicographical_compare(lhs.begin(), lhs.end(), … … 204 204 205 205 206 template<typename T >207 bool operator>(const Range<T >& lhs, const Range<T>& rhs)206 template<typename T1, typename T2> 207 bool operator>(const Range<T1>& lhs, const Range<T2>& rhs) 208 208 { 209 209 return rhs < lhs; … … 211 211 212 212 213 template<typename T >214 bool operator<=(const Range<T >& lhs, const Range<T>& rhs)213 template<typename T1, typename T2> 214 bool operator<=(const Range<T1>& lhs, const Range<T2>& rhs) 215 215 { 216 216 return ! (rhs<lhs); … … 218 218 219 219 220 template<typename T >221 bool operator>=(const Range<T >& lhs, const Range<T>& rhs)220 template<typename T1, typename T2> 221 bool operator>=(const Range<T1>& lhs, const Range<T2>& rhs) 222 222 { 223 223 return ! (lhs<rhs);
Note: See TracChangeset
for help on using the changeset viewer.