From 7b17be08a240677b0ed7b6b87008946b1fa5ceeb Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 18 Sep 2000 09:47:04 +0000 Subject: [PATCH] move integer_range to its own file [SVN r7716] --- include/boost/pending/iterator_adaptors.hpp | 59 --------------------- 1 file changed, 59 deletions(-) diff --git a/include/boost/pending/iterator_adaptors.hpp b/include/boost/pending/iterator_adaptors.hpp index aec7b87..183857f 100644 --- a/include/boost/pending/iterator_adaptors.hpp +++ b/include/boost/pending/iterator_adaptors.hpp @@ -18,10 +18,6 @@ #include #include -#ifdef BOOST_MSVC -#include -#endif - // 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 // off. Now we can test the hack with various compilers and still have an "out" @@ -32,8 +28,6 @@ namespace boost { -#ifndef BOOST_MSVC - // Just a "type envelope"; works around some MSVC deficiencies. template struct type {}; @@ -510,59 +504,6 @@ struct reverse_iterators typedef typename Adaptor::const_iterator const_iterator; }; -//============================================================================= -// Counting Iterator and Integer Range Class - -struct counting_iterator_policies : public default_iterator_policies -{ - template - 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 //#ifndef BOOST_MSVC - -template -struct integer_range { -#ifdef BOOST_MSVC - typedef int_iterator iterator; -#else - typedef iterator_adaptor, IntegerType> iterator; -#endif - typedef iterator const_iterator; - typedef IntegerType value_type; - typedef std::ptrdiff_t difference_type; - typedef IntegerType reference; - typedef IntegerType const_reference; - typedef const IntegerType* pointer; - typedef const IntegerType* const_pointer; - typedef IntegerType size_type; - - integer_range(IntegerType start, IntegerType finish) - : m_start(start), m_finish(finish) { } - - iterator begin() const { return iterator(m_start); } - iterator end() const { return iterator(m_finish); } - size_type size() const { return m_finish - m_start; } - bool empty() const { return m_finish == m_start; } - void swap(integer_range& x) { - std::swap(m_start, x.m_start); - std::swap(m_finish, x.m_finish); - } -protected: - IntegerType m_start, m_finish; -}; - - } // namespace boost #endif