diff --git a/include/boost/counting_iterator.hpp b/include/boost/counting_iterator.hpp deleted file mode 100644 index 2279c93..0000000 --- a/include/boost/counting_iterator.hpp +++ /dev/null @@ -1,178 +0,0 @@ -// (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. -// -// See http://www.boost.org for most recent version including documentation. -// -// Supplies: -// -// template class counting_iterator_traits; -// template class counting_iterator_policies; -// -// Iterator traits and policies for adapted iterators whose dereferenced -// value progresses through consecutive values of Incrementable when the -// iterator is derferenced. -// -// template -// iterator_adaptor, -// counting_iterator_traits > -// counting_iterator(Incrementable); -// -// A function which produces an adapted counting iterator over values of -// Incrementable. -// -// Revision History -// 24 Jan 2001 initial revision, based on Jeremy Siek's -// boost/pending/integer_range.hpp (David Abrahams) - -#ifndef BOOST_COUNTING_ITERATOR_HPP_DWA20000119 -# define BOOST_COUNTING_ITERATOR_HPP_DWA20000119 - -# include -# include -# include -# include -# include -# ifndef BOOST_NO_LIMITS -# include -# endif - -namespace boost { - -namespace detail { - - // Template class counting_iterator_traits_select -- choose an - // iterator_category and difference_type for a counting_iterator at - // compile-time based on whether or not it wraps an integer or an iterator, - // using "poor man's partial specialization". - template struct counting_iterator_traits_select; - - // Incrementable is an iterator type - template <> - struct counting_iterator_traits_select - { - template - struct traits - { - private: - typedef boost::detail::iterator_traits x; - public: - typedef typename x::iterator_category iterator_category; - typedef typename x::difference_type difference_type; - }; - }; - - // Incrementable is a numeric type - template <> - struct counting_iterator_traits_select - { - template - struct traits - { - typedef typename - boost::detail::numeric_traits::difference_type - difference_type; - typedef std::random_access_iterator_tag iterator_category; - }; - }; - - // Template class distance_policy_select -- choose a policy for computing the - // distance between counting_iterators at compile-time based on whether or not - // the iterator wraps an integer or an iterator, using "poor man's partial - // specialization". - - template struct distance_policy_select; - - // A policy for wrapped iterators - template <> - struct distance_policy_select - { - template - struct policy { - static Distance distance(Incrementable x, Incrementable y) - { return boost::detail::distance(x, y); } - }; - }; - - // A policy for wrapped numbers - template <> - struct distance_policy_select - { - template - struct policy { - static Distance distance(Incrementable x, Incrementable y) - { return numeric_distance(x, y); } - }; - }; - - // Compute the distance over arbitrary numeric and/or iterator types - template - Distance any_distance(Incrementable start, Incrementable finish, Distance* = 0) - { - return distance_policy_select< -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - std::numeric_limits::is_specialized -#else - // Causes warnings with GCC, but how else can I detect numeric types - // at compile-time? - (boost::is_convertible::value && - boost::is_convertible::value) -#endif - >::template policy::distance(start, finish); - } - -} // namespace detail - -template -struct counting_iterator_traits { - private: - typedef typename detail::counting_iterator_traits_select<( -#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - std::numeric_limits::is_specialized -#else - // Causes warnings with GCC, but how else can I detect numeric types at - // compile-time? - (boost::is_convertible::value && - boost::is_convertible::value) -#endif - )>::template traits traits; - public: - typedef Incrementable value_type; - typedef const Incrementable& reference; - typedef const value_type* pointer; - typedef typename traits::difference_type difference_type; - typedef typename traits::iterator_category iterator_category; -}; - -template -struct counting_iterator_policies : public default_iterator_policies -{ - const Incrementable& dereference(type, const Incrementable& i) const - { return i; } - - template - Difference distance(type, const Iterator1& x, - const Iterator2& y) const - { - return boost::detail::any_distance(x, y);//,(Difference*)()); - } -}; - -// Manufacture a counting iterator for an arbitrary incrementable type -template -inline iterator_adaptor, - counting_iterator_traits > -counting_iterator(Incrementable x) -{ - return iterator_adaptor, - counting_iterator_traits >(x); -} - -} // namespace boost - -#endif // BOOST_COUNTING_ITERATOR_HPP_DWA20000119 diff --git a/include/boost/iterator.hpp b/include/boost/iterator.hpp deleted file mode 100644 index 34e4e4b..0000000 --- a/include/boost/iterator.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// interator.hpp workarounds for non-conforming standard libraries ---------// - -// (C) Copyright Boost.org 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. - -// See http://www.boost.org for most recent version including documentation. - -// Revision History -// 12 Jan 01 added for std::ptrdiff_t (Jens Maurer) -// 28 Jun 00 Workarounds to deal with known MSVC bugs (David Abrahams) -// 26 Jun 00 Initial version (Jeremy Siek) - -#ifndef BOOST_ITERATOR_HPP -#define BOOST_ITERATOR_HPP - -#include -#include // std::ptrdiff_t -#include - -namespace boost -{ -# ifdef BOOST_NO_STD_ITERATOR - template - struct iterator - { - typedef T value_type; - typedef Distance difference_type; - typedef Pointer pointer; - typedef Reference reference; - typedef Category iterator_category; - }; -# else - - // declare iterator_base in namespace detail to work around MSVC bugs which - // prevent derivation from an identically-named class in a different namespace. - namespace detail { - template -# if !defined(BOOST_MSVC_STD_ITERATOR) - struct iterator_base : std::iterator {}; -# else - struct iterator_base : std::iterator - { - typedef Reference reference; - typedef Pointer pointer; - typedef Distance difference_type; - }; -# endif - } - - template - struct iterator : detail::iterator_base {}; -# endif -} // namespace boost - -#endif // BOOST_ITERATOR_HPP diff --git a/include/boost/pending/detail/int_iterator.hpp b/include/boost/pending/detail/int_iterator.hpp deleted file mode 100644 index 2d96185..0000000 --- a/include/boost/pending/detail/int_iterator.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// (C) Copyright Jeremy Siek 1999. 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. - -#ifndef BOOST_INT_ITERATOR_H -#define BOOST_INT_ITERATOR_H - -#include -#if !defined BOOST_MSVC -#include -#endif -#include -//using namespace std; - -#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE -namespace boost { -#endif - -// this should use random_access_iterator_helper but I've had -// VC++ portablility problems with that. -JGS -template -class int_iterator -{ - typedef int_iterator self; -public: - typedef std::random_access_iterator_tag iterator_category; - typedef IntT value_type; - typedef IntT& reference; - typedef IntT* pointer; - typedef std::ptrdiff_t difference_type; - - inline int_iterator() : _i(0) { } - inline int_iterator(IntT i) : _i(i) { } - inline int_iterator(const self& x) : _i(x._i) { } - inline self& operator=(const self& x) { _i = x._i; return *this; } - inline IntT operator*() { return _i; } - inline IntT operator[](IntT n) { return _i + n; } - inline self& operator++() { ++_i; return *this; } - inline self operator++(int) { self t = *this; ++_i; return t; } - inline self& operator+=(IntT n) { _i += n; return *this; } - inline self operator+(IntT n) { self t = *this; t += n; return t; } - inline self& operator--() { --_i; return *this; } - inline self operator--(int) { self t = *this; --_i; return t; } - inline self& operator-=(IntT n) { _i -= n; return *this; } - inline IntT operator-(const self& x) const { return _i - x._i; } - inline bool operator==(const self& x) const { return _i == x._i; } - // vc++ had a problem finding != in random_access_iterator_helper - // need to look into this... for now implementing everything here -JGS - inline bool operator!=(const self& x) const { return _i != x._i; } - inline bool operator<(const self& x) const { return _i < x._i; } - inline bool operator<=(const self& x) const { return _i <= x._i; } - inline bool operator>(const self& x) const { return _i > x._i; } - inline bool operator>=(const self& x) const { return _i >= x._i; } -protected: - IntT _i; -}; - -template -inline int_iterator -operator+(IntT n, int_iterator t) { t += n; return t; } - -#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE -} /* namespace boost */ -#endif - -#ifdef BOOST_NO_OPERATORS_IN_NAMESPACE -namespace boost { - using ::int_iterator; -} -#endif - - -#endif /* BOOST_INT_ITERATOR_H */ diff --git a/include/boost/pending/integer_range.hpp b/include/boost/pending/integer_range.hpp deleted file mode 100644 index 24a62f2..0000000 --- a/include/boost/pending/integer_range.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// (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 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. - -#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 - -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 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; -}; - -template -inline integer_range -make_integer_range(IntegerType first, IntegerType last) -{ - return integer_range(first, last); -} - -} // namespace boost - -#ifdef BOOST_USE_ITERATOR_ADAPTORS -#undef BOOST_USE_ITERATOR_ADAPTORS -#endif - -#endif // BOOST_INTEGER_RANGE_HPP_ diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp deleted file mode 100644 index 15a5ec4..0000000 --- a/include/boost/pending/iterator_tests.hpp +++ /dev/null @@ -1,173 +0,0 @@ -#ifndef BOOST_ITERATOR_TESTS_HPP -#define BOOST_ITERATOR_TESTS_HPP - -// This is meant to be the beginnings of a comprehensive, generic -// test suite for STL concepts such as iterators and containers. - -#include -#include - -namespace boost { - - // use this for the value type -struct dummyT { - dummyT() { } - dummyT(int x) : m_x(x) { } - int foo() const { return m_x; } - bool operator==(const dummyT& d) const { return m_x == d.m_x; } - int m_x; -}; - - -// Tests whether type Iterator satisfies the requirements for a -// TrivialIterator. -// Preconditions: i != j, *i == val -template -void trivial_iterator_test(const Iterator i, const Iterator j, T val) -{ - Iterator k; - assert(i == i); - assert(j == j); - assert(i != j); -#ifdef BOOST_NO_STD_ITERATOR_TRAITS - T v = *i; -#else - typename std::iterator_traits::value_type v = *i; -#endif - assert(v == val); -#if 0 - // hmm, this will give a warning for transform_iterator... perhaps - // this should be separated out into a stand-alone test since there - // are several situations where it can't be used, like for - // integer_range::iterator. - assert(v == i->foo()); -#endif - k = i; - assert(k == k); - assert(k == i); - assert(k != j); - assert(*k == val); -} - - -// Preconditions: i != j -template -void mutable_trivial_iterator_test(const Iterator i, const Iterator j, T val) -{ - *i = val; - trivial_iterator_test(i, j, val); -} - - -// Preconditions: *i == v1, *++i == v2 -template -void input_iterator_test(Iterator i, T v1, T v2) -{ - Iterator i1 = i, i2 = i; - - assert(i == i1++); - assert(i != ++i2); - - trivial_iterator_test(i, i1, v1); - trivial_iterator_test(i, i2, v1); - - ++i; - assert(i == i1); - assert(i == i2); - ++i1; - ++i2; - - trivial_iterator_test(i, i1, v2); - trivial_iterator_test(i, i2, v2); -} - -// how to test output iterator? - -template -void forward_iterator_test(Iterator i, T v1, T v2) -{ - input_iterator_test(i, v1, v2); -} - -// Preconditions: *i == v1, *++i == v2 -template -void bidirectional_iterator_test(Iterator i, T v1, T v2) -{ - input_iterator_test(i, v1, v2); - ++i; - - Iterator i1 = i, i2 = i; - - assert(i == i1--); - assert(i != --i2); - - trivial_iterator_test(i, i1, v2); - trivial_iterator_test(i, i2, v2); - - --i; - assert(i == i1); - assert(i == i2); - --i1; - --i2; - - trivial_iterator_test(i, i1, v1); - trivial_iterator_test(i, i2, v1); -} - -// mutable_bidirectional_iterator_test - -// Preconditions: [i,i+N) is a valid range -template -void random_access_iterator_test(Iterator i, int N, TrueVals vals) -{ - bidirectional_iterator_test(i, vals[0], vals[1]); - const Iterator j = i; - int c; - - for (c = 0; c < N-1; ++c) { - assert(i == j + c); - assert(*i == vals[c]); - assert(*i == j[c]); - assert(*i == *(j + c)); - assert(*i == *(c + j)); - ++i; - assert(i > j); - assert(i >= j); - assert(j <= i); - assert(j < i); - } - - Iterator k = j + N - 1; - for (c = 0; c < N-1; ++c) { - assert(i == k - c); - assert(*i == vals[N - 1 - c]); - assert(*i == j[N - 1 - c]); - Iterator q = k - c; - assert(*i == *q); - assert(i > j); - assert(i >= j); - assert(j <= i); - assert(j < i); - --i; - } -} - -// Precondition: i != j -template -void const_nonconst_iterator_test(Iterator i, ConstIterator j) -{ - assert(i != j); - assert(j != i); - - ConstIterator k(i); - assert(k == i); - assert(i == k); - - k = i; - assert(k == i); - assert(i == k); -} - -} // namespace boost - -#endif // BOOST_ITERATOR_TESTS_HPP