diff --git a/include/boost/pending/integer_range.hpp b/include/boost/pending/integer_range.hpp index 24a62f2..e1b8720 100644 --- a/include/boost/pending/integer_range.hpp +++ b/include/boost/pending/integer_range.hpp @@ -1,63 +1,27 @@ -// (C) Copyright David Abrahams 2000. Permission to copy, use, -// modify, sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. +// (C) Copyright David Abrahams and Jeremy Siek 2000-2001. Permission to copy, +// use, modify, sell and distribute this software is granted provided this +// copyright notice appears in all copies. This software is provided "as is" +// without express or implied warranty, and with no claim as to its suitability +// for any purpose. // -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. +// Revision History: +// 04 Jan 2001 Factored counting_iterator stuff into +// boost/counting_iterator.hpp (David Abrahams) #ifndef BOOST_INTEGER_RANGE_HPP_ #define BOOST_INTEGER_RANGE_HPP_ #include - -#if 1 -// Still evaluating whether VC++ can handle this. -#define BOOST_USE_ITERATOR_ADAPTORS -#endif - -#ifdef BOOST_USE_ITERATOR_ADAPTORS -#include -#else -#include -#endif +#include namespace boost { //============================================================================= // Counting Iterator and Integer Range Class -#ifdef BOOST_USE_ITERATOR_ADAPTORS -template -struct counting_iterator_policies : public default_iterator_policies -{ - IntegerType - dereference(type, const IntegerType& i) const - { return i; } -}; -template -struct counting_iterator_traits { - typedef IntegerType value_type; - typedef IntegerType reference; - typedef value_type* pointer; - typedef std::ptrdiff_t difference_type; - typedef std::random_access_iterator_tag iterator_category; -}; -#endif - template struct integer_range { -#ifdef BOOST_USE_ITERATOR_ADAPTORS - typedef iterator_adaptor, - counting_iterator_traits > iterator; -#else - typedef int_iterator iterator; -#endif + typedef typename counting_iterator_generator::type iterator; typedef iterator const_iterator; typedef IntegerType value_type; @@ -92,8 +56,4 @@ make_integer_range(IntegerType first, IntegerType last) } // namespace boost -#ifdef BOOST_USE_ITERATOR_ADAPTORS -#undef BOOST_USE_ITERATOR_ADAPTORS -#endif - #endif // BOOST_INTEGER_RANGE_HPP_