mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-30 21:07:20 +02:00
completed codewarrior workaround
[SVN r8169]
This commit is contained in:
@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
// I was having some problems with VC6. I couldn't tell whether our hack for
|
// I was having some problems with VC6. I couldn't tell whether our hack for
|
||||||
// stock GCC was causing problems so I needed an easy way to turn it on and
|
// stock GCC was causing problems so I needed an easy way to turn it on and
|
||||||
// off. Now we can test the hack with various compilers and still have an "out"
|
// off. Now we can test the hack with various compilers and still have an
|
||||||
// if it doesn't work. -dwa 7/31/00
|
// "out" if it doesn't work. -dwa 7/31/00
|
||||||
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
|
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
|
||||||
# define BOOST_RELOPS_AMBIGUITY_BUG 1
|
# define BOOST_RELOPS_AMBIGUITY_BUG 1
|
||||||
#endif
|
#endif
|
||||||
@ -32,7 +32,7 @@ namespace boost {
|
|||||||
template <class T>
|
template <class T>
|
||||||
struct type {};
|
struct type {};
|
||||||
|
|
||||||
//=============================================================================
|
//============================================================================
|
||||||
// Default policies for iterator adaptors. You can use this as a base
|
// Default policies for iterator adaptors. You can use this as a base
|
||||||
// class if you want to customize particular policies.
|
// class if you want to customize particular policies.
|
||||||
struct default_iterator_policies
|
struct default_iterator_policies
|
||||||
@ -57,7 +57,8 @@ struct default_iterator_policies
|
|||||||
{ x += n; }
|
{ x += n; }
|
||||||
|
|
||||||
template <class Difference, class Iterator1, class Iterator2>
|
template <class Difference, class Iterator1, class Iterator2>
|
||||||
Difference distance(type<Difference>, const Iterator1& x, const Iterator2& y) const
|
Difference distance(type<Difference>, const Iterator1& x,
|
||||||
|
const Iterator2& y) const
|
||||||
{ return y - x; }
|
{ return y - x; }
|
||||||
|
|
||||||
template <class Iterator1, class Iterator2>
|
template <class Iterator1, class Iterator2>
|
||||||
@ -131,7 +132,7 @@ inline bool operator<=(const iterator_comparisons<D1,Base1>& xb,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//=============================================================================
|
//============================================================================
|
||||||
// iterator_adaptor - A generalized adaptor around an existing
|
// iterator_adaptor - A generalized adaptor around an existing
|
||||||
// iterator, which is itself an iterator
|
// iterator, which is itself an iterator
|
||||||
//
|
//
|
||||||
@ -240,19 +241,31 @@ public:
|
|||||||
Self operator++(int) { Self tmp(*this); ++*this; return tmp; }
|
Self operator++(int) { Self tmp(*this); ++*this; return tmp; }
|
||||||
|
|
||||||
Self& operator--() {
|
Self& operator--() {
|
||||||
|
#ifdef __MWERKS__
|
||||||
|
policies().decrement<Iterator>(iter());
|
||||||
|
#else
|
||||||
policies().decrement(iter());
|
policies().decrement(iter());
|
||||||
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Self operator--(int) { Self tmp(*this); --*this; return tmp; }
|
Self operator--(int) { Self tmp(*this); --*this; return tmp; }
|
||||||
|
|
||||||
Self& operator+=(difference_type n) {
|
Self& operator+=(difference_type n) {
|
||||||
|
#ifdef __MWERKS__
|
||||||
|
policies().advance<Iterator>(iter(), n);
|
||||||
|
#else
|
||||||
policies().advance(iter(), n);
|
policies().advance(iter(), n);
|
||||||
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Self& operator-=(difference_type n) {
|
Self& operator-=(difference_type n) {
|
||||||
|
#ifdef __MWERKS__
|
||||||
|
policies().advance<Iterator>(iter(), -n);
|
||||||
|
#else
|
||||||
policies().advance(iter(), -n);
|
policies().advance(iter(), -n);
|
||||||
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user