From 34a9d4e702be5b8abd2dc70f560040ee89f275a4 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sun, 14 Jan 2001 21:10:44 +0000 Subject: [PATCH] another MIPSpro workaround [SVN r8597] --- include/boost/pending/iterator_adaptors.hpp | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/include/boost/pending/iterator_adaptors.hpp b/include/boost/pending/iterator_adaptors.hpp index a2f394d..f454d10 100644 --- a/include/boost/pending/iterator_adaptors.hpp +++ b/include/boost/pending/iterator_adaptors.hpp @@ -235,7 +235,7 @@ namespace detail { return &(*i); } - // Dummy version for iterators that don't support member access + // Dummy version for non-random access iterators template inline void advance_impl(Iter&, Diff, Cat) { } @@ -250,6 +250,21 @@ namespace detail { #endif } + // Dummy version for non-bidirectional iterators + template + inline void decrement_impl(Iter&, Cat) { } + + // Real version + template + inline typename Iter::pointer + decrement_impl(Iter& i, std::bidirectional_iterator_tag) { +#ifdef __MWERKS__ + i.policies().decrement(i.iter()); +#else + i.policies().decrement(i.iter()); +#endif + } + } // namespace detail //============================================================================ @@ -336,11 +351,7 @@ public: Self operator++(int) { Self tmp(*this); ++*this; return tmp; } Self& operator--() { -#ifdef __MWERKS__ - policies().decrement(iter()); -#else - policies().decrement(iter()); -#endif + detail::decrement_impl(*this, iterator_category()); return *this; }