completed codewarrior workaround

[SVN r8169]
This commit is contained in:
Jeremy Siek
2000-11-10 16:24:39 +00:00
parent ea1513596d
commit 87a3007c92

View File

@ -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
// //
@ -167,7 +168,7 @@ struct iterator_adaptor :
> >
#endif #endif
{ {
typedef iterator_adaptor<Iterator, Policies, Traits,NonconstIterator> Self; typedef iterator_adaptor<Iterator, Policies,Traits,NonconstIterator> Self;
public: public:
typedef typename Traits::difference_type difference_type; typedef typename Traits::difference_type difference_type;
typedef typename Traits::value_type value_type; typedef typename Traits::value_type value_type;
@ -178,7 +179,7 @@ public:
iterator_adaptor() { } iterator_adaptor() { }
iterator_adaptor(const iterator_type& iter, const Policies& p = Policies()) iterator_adaptor(const iterator_type& iter, const Policies& p =Policies())
: m_iter_p(iter, p) {} : m_iter_p(iter, p) {}
#ifdef BOOST_MSVC6_MEMBER_TEMPLATES #ifdef BOOST_MSVC6_MEMBER_TEMPLATES
@ -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;
} }