mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 05:23:52 +00:00
some concept checking changes as per review comments
[SVN r8268]
This commit is contained in:
parent
87a3007c92
commit
80bcc4e643
@ -40,7 +40,7 @@ public:
|
||||
inline self& operator++() { ++_i; return *this; }
|
||||
inline self operator++(int) { self t = *this; ++_i; return t; }
|
||||
inline self& operator+=(IntT n) { _i += n; return *this; }
|
||||
inline self operator+(IntT n) { self t = *this; t._i += n; return t; }
|
||||
inline self operator+(IntT n) { self t = *this; t += n; return t; }
|
||||
inline self& operator--() { --_i; return *this; }
|
||||
inline self operator--(int) { self t = *this; --_i; return t; }
|
||||
inline self& operator-=(IntT n) { _i -= n; return *this; }
|
||||
@ -50,10 +50,17 @@ public:
|
||||
// need to look into this... for now implementing everything here -JGS
|
||||
inline bool operator!=(const self& x) const { return _i != x._i; }
|
||||
inline bool operator<(const self& x) const { return _i < x._i; }
|
||||
inline bool operator<=(const self& x) const { return _i <= x._i; }
|
||||
inline bool operator>(const self& x) const { return _i > x._i; }
|
||||
inline bool operator>=(const self& x) const { return _i >= x._i; }
|
||||
protected:
|
||||
IntT _i;
|
||||
};
|
||||
|
||||
template <class IntT>
|
||||
inline int_iterator<IntT>
|
||||
operator+(IntT n, int_iterator<IntT> t) { t += n; return t; }
|
||||
|
||||
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
|
||||
} /* namespace boost */
|
||||
#endif
|
||||
|
@ -141,7 +141,8 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals)
|
||||
assert(i == k - c);
|
||||
assert(*i == vals[N - 1 - c]);
|
||||
assert(*i == j[N - 1 - c]);
|
||||
assert(*i == *(k - c));
|
||||
Iterator q = k - c;
|
||||
assert(*i == *q);
|
||||
assert(i > j);
|
||||
assert(i >= j);
|
||||
assert(j <= i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user