From 8d549f45fd4c3981b537ea2a2c89c5723404aa27 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 4 Dec 2002 15:52:33 +0000 Subject: [PATCH] Workarounds for broken RogueWave lib that comes with Sun [SVN r16509] --- include/boost/detail/iterator.hpp | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/include/boost/detail/iterator.hpp b/include/boost/detail/iterator.hpp index 9654add..40bfd41 100644 --- a/include/boost/detail/iterator.hpp +++ b/include/boost/detail/iterator.hpp @@ -98,6 +98,42 @@ struct iterator_traits : std::iterator_traits {}; using std::distance; +# elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_MSVC_STD_ITERATOR) + +// Rogue Wave Standard Library fools itself into thinking partial +// specialization is missing on some platforms (e.g. Sun), so fails to +// supply iterator_traits! +template +struct iterator_traits +{ + typedef typename Iterator::value_type value_type; + typedef typename Iterator::reference reference; + typedef typename Iterator::pointer pointer; + typedef typename Iterator::difference_type difference_type; + typedef typename Iterator::iterator_category iterator_category; +}; + +template +struct iterator_traits +{ + typedef T value_type; + typedef T& reference; + typedef T* pointer; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; +}; + +template +struct iterator_traits +{ + typedef T value_type; + typedef T const& reference; + typedef T const* pointer; + typedef std::ptrdiff_t difference_type; + typedef std::random_access_iterator_tag iterator_category; +}; + # else // is_mutable_iterator --