Small changes to support new iterator adaptors in sandbox

[SVN r18212]
This commit is contained in:
Dave Abrahams
2003-04-09 11:57:59 +00:00
parent 124be84389
commit 69c7068028

View File

@@ -62,7 +62,7 @@
# include <cstddef> # include <cstddef>
// should be the last #include // should be the last #include
#include "boost/type_traits/detail/bool_trait_def.hpp" # include "boost/type_traits/detail/bool_trait_def.hpp"
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no // STLPort 4.0 and betas have a bug when debugging is enabled and there is no
// partial specialization: instead of an iterator_category typedef, the standard // partial specialization: instead of an iterator_category typedef, the standard
@@ -92,15 +92,20 @@ BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \ # if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_MSVC_STD_ITERATOR)
// Define a new template so it can be specialized // Define a new template so it can be specialized
template <class Iterator> template <class Iterator>
struct iterator_traits struct iterator_traits
: std::iterator_traits<Iterator> : std::iterator_traits<Iterator>
{}; {};
using std::distance; using std::distance;
# elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
# else
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_MSVC_STD_ITERATOR)
// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
// Rogue Wave Standard Library fools itself into thinking partial // Rogue Wave Standard Library fools itself into thinking partial
// specialization is missing on some platforms (e.g. Sun), so fails to // specialization is missing on some platforms (e.g. Sun), so fails to
// supply iterator_traits! // supply iterator_traits!
@@ -389,6 +394,8 @@ struct iterator_traits
// This specialization cuts off ETI (Early Template Instantiation) for MSVC. // This specialization cuts off ETI (Early Template Instantiation) for MSVC.
template <> struct iterator_traits<int>{}; template <> struct iterator_traits<int>{};
# endif
namespace iterator_traits_ namespace iterator_traits_
{ {
template <class Iterator, class Difference> template <class Iterator, class Difference>