diff --git a/development/boost/iterator_categories.hpp b/development/boost/iterator_categories.hpp deleted file mode 100644 index 138a5be..0000000 --- a/development/boost/iterator_categories.hpp +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef BOOST_ITERATOR_CATEGORIES_HPP -#define BOOST_ITERATOR_CATEGORIES_HPP - -#include -#include -#include -#include -#include - -namespace boost { - - // Return Type Categories - struct readable_iterator_tag { }; - struct writable_iterator_tag { }; - struct swappable_iterator_tag { }; - struct mutable_lvalue_iterator_tag : - virtual public writable_iterator_tag, - virtual public readable_iterator_tag { }; - struct constant_lvalue_iterator_tag : - virtual public readable_iterator_tag { }; - - // Traversal Categories - struct forward_traversal_tag { }; - struct bidirectional_traversal_tag : public forward_traversal_tag { }; - struct random_access_traversal_tag : public bidirectional_traversal_tag { }; - - struct error_iterator_tag { }; - - // Inherit from iterator_base if your iterator defines its own - // return_category and traversal_category. Otherwise, the "old style" - // iterator category will be mapped to the return_category and - // traversal_category. - struct new_iterator_base { }; - - namespace detail { - - struct return_category_from_nested_type { - template struct bind { - typedef typename Iterator::return_category type; - }; - }; - - struct traversal_category_from_nested_type { - template struct bind { - typedef typename Iterator::traversal_category type; - }; - }; - - template - struct choose_lvalue_return { - typedef typename ct_if::value, - boost::constant_lvalue_iterator_tag, - boost::mutable_lvalue_iterator_tag>::type type; - }; - - - template - struct iter_category_to_return { - typedef typename ct_if< - is_convertible::value, - typename choose_lvalue_return::type, - typename ct_if< - is_convertible::value, - boost::readable_iterator_tag, - typename ct_if< - is_convertible::value, - boost::writable_iterator_tag, - boost::error_iterator_tag - >::type - >::type - >::type type; - }; - - template - struct iter_category_to_traversal { - typedef typename ct_if< - is_convertible::value, - random_access_traversal_tag, - typename ct_if< - is_convertible::value, - bidirectional_traversal_tag, - forward_traversal_tag - >::type - >::type type; - }; - - struct return_category_from_old_traits { - template class bind { - typedef boost::detail::iterator_traits OldTraits; - typedef typename OldTraits::iterator_category Cat; - typedef typename OldTraits::value_type value_type; - public: - typedef iter_category_to_return::type type; - }; - }; - - struct traversal_category_from_old_traits { - template class bind { - typedef boost::detail::iterator_traits OldTraits; - typedef typename OldTraits::iterator_category Cat; - public: - typedef iter_category_to_traversal::type type; - }; - }; - - template - class choose_return_category { - typedef typename ct_if::value, - return_category_from_nested_type, - return_category_from_old_traits>::type Choice; - public: - typedef typename Choice:: template bind::type type; - }; - - template - class choose_traversal_category { - typedef typename ct_if::value, - traversal_category_from_nested_type, - traversal_category_from_old_traits>::type Choice; - public: - typedef typename Choice:: template bind::type type; - }; - - } // namespace detail - - template - struct return_category { - typedef typename detail::choose_return_category::type type; - }; - - - template - struct traversal_category { - typedef typename detail::choose_traversal_category::type type; - }; - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - - template - struct return_category - { - typedef typename ct_if::value, - constant_lvalue_iterator_tag, - mutable_lvalue_iterator_tag>::type type; - }; - - template - struct traversal_category - { - typedef random_access_traversal_tag type; - }; - -#endif - -} // namespace boost - -#endif // BOOST_ITERATOR_CATEGORIES_HPP diff --git a/development/boost/iterator_concepts.hpp b/development/boost/iterator_concepts.hpp deleted file mode 100644 index a30ff17..0000000 --- a/development/boost/iterator_concepts.hpp +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef BOOST_ITERATOR_CONCEPTS_HPP -#define BOOST_ITERATOR_CONCEPTS_HPP - -#include -#include -#include -#include - -namespace boost_concepts { - // Used a different namespace here (instead of "boost") so that the - // concept descriptions do not take for granted the names in - // namespace boost. - - - //=========================================================================== - // Iterator Access Concepts - - template - class ReadableIteratorConcept { - public: - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::reference reference; - typedef typename boost::return_category::type return_category; - - void constraints() { - boost::function_requires< boost::SGIAssignableConcept >(); - boost::function_requires< boost::EqualityComparableConcept >(); - boost::function_requires< - boost::DefaultConstructibleConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - reference r = *i; // or perhaps read(x) - value_type v(r); - boost::ignore_unused_variable_warning(v); - } - Iterator i; - }; - - template - class WritableIteratorConcept { - public: - typedef typename boost::return_category::type return_category; - - void constraints() { - boost::function_requires< boost::SGIAssignableConcept >(); - boost::function_requires< boost::EqualityComparableConcept >(); - boost::function_requires< - boost::DefaultConstructibleConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - *i = v; // a good alternative could be something like write(x, v) - } - ValueType v; - Iterator i; - }; - - template - class ConstantLvalueIteratorConcept { - public: - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::reference reference; - typedef typename boost::return_category::type return_category; - - void constraints() { - boost::function_requires< ReadableIteratorConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - BOOST_STATIC_ASSERT((boost::is_same::value)); - - reference v = *i; - boost::ignore_unused_variable_warning(v); - } - Iterator i; - }; - - template - class MutableLvalueIteratorConcept { - public: - typedef typename std::iterator_traits::value_type value_type; - typedef typename std::iterator_traits::reference reference; - typedef typename boost::return_category::type return_category; - - void constraints() { - boost::function_requires< ReadableIteratorConcept >(); - boost::function_requires< - WritableIteratorConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - BOOST_STATIC_ASSERT((boost::is_same::value)); - - reference v = *i; - boost::ignore_unused_variable_warning(v); - } - Iterator i; - }; - - //=========================================================================== - // Iterator Traversal Concepts - - template - class ForwardIteratorConcept { - public: - typedef typename boost::traversal_category::type traversal_category; - - void constraints() { - boost::function_requires< boost::SGIAssignableConcept >(); - boost::function_requires< boost::EqualityComparableConcept >(); - boost::function_requires< - boost::DefaultConstructibleConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - ++i; - (void)i++; - } - Iterator i; - }; - - template - class BidirectionalIteratorConcept { - public: - typedef typename boost::traversal_category::type traversal_category; - - void constraints() { - boost::function_requires< ForwardIteratorConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - --i; - (void)i--; - } - Iterator i; - }; - - template - class RandomAccessIteratorConcept { - public: - typedef typename boost::traversal_category::type traversal_category; - typedef typename std::iterator_traits::difference_type - difference_type; - - void constraints() { - boost::function_requires< BidirectionalIteratorConcept >(); - - BOOST_STATIC_ASSERT((boost::is_convertible::value)); - - i += n; - i = i + n; - i = n + i; - i -= n; - i = i - n; - n = i - j; - } - difference_type n; - Iterator i, j; - }; - -} // namespace boost_concepts - - -#endif // BOOST_ITERATOR_CONCEPTS_HPP diff --git a/development/libs/iterator/concept_tests.cpp b/development/libs/iterator/concept_tests.cpp deleted file mode 100644 index f75f311..0000000 --- a/development/libs/iterator/concept_tests.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include - -struct new_iterator - : public boost::iterator, - public boost::new_iterator_base -{ - typedef boost::random_access_traversal_tag traversal_category; - typedef boost::mutable_lvalue_iterator_tag return_category; - - int& operator*() const { return *m_x; } - new_iterator& operator++() { return *this; } - new_iterator operator++(int) { return *this; } - new_iterator& operator--() { return *this; } - new_iterator operator--(int) { return *this; } - new_iterator& operator+=(std::ptrdiff_t) { return *this; } - new_iterator operator+(std::ptrdiff_t) { return *this; } - new_iterator& operator-=(std::ptrdiff_t) { return *this; } - std::ptrdiff_t operator-(const new_iterator&) const { return 0; } - new_iterator operator-(std::ptrdiff_t) const { return *this; } - bool operator==(const new_iterator&) const { return false; } - bool operator!=(const new_iterator&) const { return false; } - bool operator<(const new_iterator&) const { return false; } - int* m_x; -}; -new_iterator operator+(std::ptrdiff_t, new_iterator x) { return x; } - -struct old_iterator - : public boost::iterator -{ - int& operator*() const { return *m_x; } - old_iterator& operator++() { return *this; } - old_iterator operator++(int) { return *this; } - old_iterator& operator--() { return *this; } - old_iterator operator--(int) { return *this; } - old_iterator& operator+=(std::ptrdiff_t) { return *this; } - old_iterator operator+(std::ptrdiff_t) { return *this; } - old_iterator& operator-=(std::ptrdiff_t) { return *this; } - old_iterator operator-(std::ptrdiff_t) const { return *this; } - std::ptrdiff_t operator-(const old_iterator&) const { return 0; } - bool operator==(const old_iterator&) const { return false; } - bool operator!=(const old_iterator&) const { return false; } - bool operator<(const old_iterator&) const { return false; } - int* m_x; -}; -old_iterator operator+(std::ptrdiff_t, old_iterator x) { return x; } - -int -main() -{ -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - boost::function_requires< - boost_concepts::MutableLvalueIteratorConcept >(); - boost::function_requires< - boost_concepts::RandomAccessIteratorConcept >(); - - boost::function_requires< - boost_concepts::ConstantLvalueIteratorConcept >(); - boost::function_requires< - boost_concepts::RandomAccessIteratorConcept >(); -#endif - - boost::function_requires< - boost_concepts::MutableLvalueIteratorConcept >(); - boost::function_requires< - boost_concepts::RandomAccessIteratorConcept >(); - - boost::function_requires< - boost_concepts::MutableLvalueIteratorConcept >(); - boost::function_requires< - boost_concepts::RandomAccessIteratorConcept >(); - return 0; -} diff --git a/development/libs/iterator/iterator_categories.htm b/development/libs/iterator/iterator_categories.htm deleted file mode 100644 index 83c29e5..0000000 --- a/development/libs/iterator/iterator_categories.htm +++ /dev/null @@ -1,160 +0,0 @@ - - - - Boost Iterator Traits - - - -C++ Boost -
- -

Boost Iterator Category Traits

-Header boost/iterator_categories.hpp - -

-The boost::traversal_category and -boost::return_category traits classes provides access to the -category tags for iterators that model the Boost Iterator Concepts, which are a -replacement for the iterator requirements in the C++ standard. The -other associated types of the Boost iterator concepts are accessed -through the std::iterator_traits class. - -

    -
  • traversal_category<Iter>::type   Can the iterator go forward, backward, etc.? -
  • return_category<Iter>::type   Is the iterator read or write only? - Is the dereferenced type an lvalue? -
- -

-An important feature of the boost::traversal_category and -boost::return_category classes is that they are backwards -compatible, i.e., they automatically work for iterators for which -there are valid definitions of std::iterator_traits. The old -iterator_category is mapped to the appropriate traversal and -return categories. - -

-When creating a new iterator type that is meant to work with -boost::traversal_category and -boost::return_category, you can either create a -specialization of these classes for your iterator type, or you can -provide all the necessary associated types as nested typedefs. In -this case, your iterator class will need to inherit from -new_iterator_base to let the category traits know -that it will be able to find typedefs for traversal_category -and return_category in you iterator class. - - -Each of the new iterator requirements will need a category tag. - -

-namespace boost {
-
-  // Return Type Categories
-  struct readable_iterator_tag { };
-  struct writable_iterator_tag { };
-  struct swappable_iterator_tag { };
-  struct mutable_lvalue_iterator_tag : virtual public writable_iterator_tag,
-    virtual public readable_iterator_tag { };
-  struct constant_lvalue_iterator_tag : public readable_iterator_tag { };
-
-  // Traversal Categories
-  struct forward_traversal_tag { };
-  struct bidirectional_traversal_tag : public forward_traversal_tag { };
-  struct random_access_traversal_tag : public bidirectional_traversal_tag { };
-
-}
-
- -

-The following is pseudo-code for the iterator category traits classes. - -

-namespace boost {
-
-  // Inherit from iterator_base if your iterator defines its own
-  // return_category and traversal_category. Otherwise, the "old style"
-  // iterator category will be mapped to the return_category and
-  // traversal_category.
-  struct new_iterator_base { };
-
-  template <typename Iterator>
-  struct return_category
-  {
-    // Pseudo-code
-    if (Iterator inherits from new_iterator_base) {
-      typedef typename Iterator::return_category type;
-    } else {
-      typedef std::iterator_traits<Iterator> OldTraits;
-      typedef typename OldTraits::iterator_category Cat;
-      if (Cat inherits from std::forward_iterator_tag)
-	if (is-const(T))
-	  typedef boost::constant_lvalue_iterator_tag type;
-	else
-	  typedef boost::mutable_lvalue_iterator_tag type;
-      else if (Cat inherits from std::input_iterator_tag)
-	typedef boost::readable_iterator_tag type;
-      else if (Cat inherits from std::output_iterator_tag)
-	typedef boost::writable_iterator_tag type;
-    }
-  };
-
-  template <typename T>
-  struct return_category<T*>
-  {
-    // Pseudo-code
-    if (is-const(T))
-      typedef boost::constant_lvalue_iterator_tag type;
-    else
-      typedef boost::mutable_lvalue_iterator_tag type;
-  };
-
-  template <typename Iterator>
-  struct traversal_category
-  {
-    // Pseudo-code
-    if (Iterator inherits from new_iterator_base) {
-      typedef typename Iterator::traversal_category type;
-    } else {
-      typedef std::iterator_traits<Iterator> OldTraits;
-      typedef typename OldTraits::iterator_category Cat;
-
-      if (Cat inherits from std::random_access_iterator_tag)
-	typedef boost::random_access_traversal_tag type;
-      else if (Cat inherits from std::bidirectional_iterator_tag)
-	typedef boost::bidirectional_traversal_tag type;
-      else if (Cat inherits from std::forward_iterator_tag)
-	typedef boost::forward_traversal_tag type;
-    }
-  };
-
-  template <typename T>
-  struct traversal_category<T*>
-  {
-    typedef boost::random_access_traversal_tag type;
-  };
-
-}
-
- -
-
jeremy siek
- - -Last modified: Mon Mar 19 12:59:30 EST 2001 - - - diff --git a/development/libs/iterator/iterator_concepts.fig b/development/libs/iterator/iterator_concepts.fig deleted file mode 100644 index 198205e..0000000 --- a/development/libs/iterator/iterator_concepts.fig +++ /dev/null @@ -1,37 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -6 150 2325 4275 4350 -2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1725 4050 1725 3450 -2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1725 3150 1725 2550 -4 0 0 100 0 19 18 0.0000 4 210 3180 375 2550 ForwardTraversalIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 3765 225 3450 BidirectionalTraversalIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 4125 150 4350 RandomAccessTraversalIterator\001 --6 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 4800 3600 4800 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 5400 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 7500 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 9075 2475 -4 0 0 100 0 19 18 0.0000 4 210 2040 6600 2400 WritableIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 2145 3900 2400 ReadableIterator\001 -4 0 0 50 0 19 18 0.0000 4 210 2835 5700 3300 MutableLvalueIterator\001 -4 0 0 50 0 19 18 0.0000 4 270 2355 9075 2400 SwappableIterator\001 -4 0 0 50 0 19 18 0.0000 4 210 2970 3825 3900 ConstantLvalueIterator\001 diff --git a/development/libs/iterator/iterator_concepts.gif b/development/libs/iterator/iterator_concepts.gif deleted file mode 100644 index bac35c7..0000000 Binary files a/development/libs/iterator/iterator_concepts.gif and /dev/null differ diff --git a/development/libs/iterator/iterator_concepts.htm b/development/libs/iterator/iterator_concepts.htm deleted file mode 100644 index f2f8dcd..0000000 --- a/development/libs/iterator/iterator_concepts.htm +++ /dev/null @@ -1,663 +0,0 @@ - - - - -Iterator Concepts - -C++ Boost - -
- - -

Iterator Concepts

- -

The standard iterator categories and requirements are flawed because -they use a single hierarchy of requirements to address two orthogonal -issues: iterator traversal and dereference return -type. The current iterator requirement hierarchy is mainly -geared towards iterator traversal (hence the category names), while -requirements that address dereference return type sneak in at various -places. - -

-The iterator requirements should be separated into two hierarchies. -One set of concepts handles the return type semantics: -

- -The other set of concepts handles iterator traversal: - - - -The current Input Iterator and Output Iterator requirements will -continue to be used as is. Note that Input Iterator implies Readable -Iterator and Output Iterator implies Writable Iterator. - -

-Note: we considered defining a Single-Pass Iterator, which could be -combined with Readable or Writable Iterator to replace the Input and -Output Iterator requirements. We rejected this idea because there are -some differences between Input and Output Iterators that make it hard -to merge them: for example Input Iterator requires Equality Comparable -while Output Iterator does not. - - -

-
- - - -
Figure 1: -The iterator concepts and refinement relationships. -
-
-

- - -

Relationship with the standard iterator concepts

- -

-std::Input Iterator implies boost::ReadableIterator. - -

-std::Output Iterator implies boost::Writable Iterator. - -

-std::Forward Iterator refines boost::Forward Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - -

-std::Bidirectional Iterator refines boost::Bidirectional Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - -

-std::Random Access Iterator refines boost::Random Access Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - - -

Notation

- - - - - - - - - - - - - - - - - -
XThe iterator type.
TThe value type of X, i.e., std::iterator_traits<X>::value_type.
x, yAn object of type X.
tAn object of type T.
- -

- -


- - -

-Readable Iterator -

- -A Readable Iterator is an iterator that dereferences to produce an -rvalue that is convertible to the value_type of the -iterator. - -

Associated Types

- - - - - - - - - - - - - - - - - - - - - -
Value typestd::iterator_traits<X>::value_typeThe type of the objects pointed to by the iterator.
Reference typestd::iterator_traits<X>::reference - The return type of dereferencing the iterator. This - type must be convertible to T. -
Return Categorystd::return_category<X>::type - A type convertible to std::readable_iterator_tag -
- -

Refinement of

- -Copy Constructible - -

Valid expressions

- - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Dereference*x std::iterator_traits<X>::reference
Member accessx->mT is a type with a member named m. -If m is a data member, the type of m. -If m is a member function, the return type of m. -
- -

- -


- - -

-Writable Iterator -

- -A Writable Iterator is an iterator that can be used to store a value -using the dereference-assignment expression. - -

Definitions

- -If x is an Writable Iterator of type X, then the -expression *x = a; stores the value a into -x. Note that operator=, like other C++ functions, -may be overloaded; it may, in fact, even be a template function. In -general, then, a may be any of several different types. A -type A belongs to the set of value types of X -if, for an object a of type A, *x = a; is -well-defined and does not require performing any non-trivial -conversions on a. - -

Associated Types

- - - - - - - - - -
Return Categorystd::return_category<X>::type - A type convertible to std::writable_iterator_tag -
- - - -

Refinement of

- -Copy Constructible - -

Valid expressions

- - - - - - - - - - -
NameExpressionReturn type
Dereference assignment*x = aunspecified
- -

- - -


- - -

-Swappable Iterator -

- -A Swappable Iterator is an iterator whose dereferenced values can be -swapped. - -

-Note: the requirements for Swappable Iterator are dependent on the -issues surrounding std::swap() being resolved. Here we assume -that the issue will be resolved by allowing the overload of -std::swap() for user-defined types. - -

-Note: Readable Iterator and Writable Iterator combined implies -Swappable Iterator because of the fully templated -std::swap(). However, Swappable Iterator does not imply -Readable Iterator nor Writable Iterator. - -

Associated Types

- - - - - - - - - -
Return Categorystd::return_category<X>::type - A type convertible to std::swappable_iterator_tag -
- - -

Valid expressions

- -Of the two valid expressions listed below, only one OR the -other is required. If std::iter_swap() is overloaded for -X then std::swap() is not required. If -std::iter_swap() is not overloaded for X then the -default (fully templated) version is used, which will call -std::swap() (this means changing the current requirements for -std::iter_swap()). - -

- - - - - - - - - - - - - - - - - -
NameExpressionReturn type
Iterator Swapstd::iter_swap(x, y)void
Dereference and Swapstd::swap(*x, *y)void
- -

- - -


- - -

-Constant Lvalue Iterator -

- -A Constant Lvalue Iterator is an iterator that dereferences to produce a -const reference to the pointed-to object, i.e., the associated -reference type is const T&. Changing the value -of or destroying an iterator that models Constant Lvalue Iterator does -not invalidate pointers and references previously obtained from that -iterator. - - -

Refinement of

- -Readable Iterator - -

Associated Types

- - - - - - - - - - - - - - - - - -
Reference typestd::iterator_traits<X>::reference - The return type of dereferencing the iterator, which must be - const T&. -
Return Categorystd::return_category<X>::type - A type convertible to std::constant_lvalue_iterator_tag -
- - - -

- -


- - -

-Mutable Lvalue Iterator -

- -A Mutable Lvalue Iterator is an iterator that dereferences to produce a -reference to the pointed-to object. The associated reference -type is T&. Changing the value of or destroying an -iterator that models Mutable Lvalue Iterator does not invalidate -pointers and references previously obtained from that iterator. - -

Refinement of

- -Readable Iterator, -Writable Iterator, -and Swappable Iterator. - - - -

Associated Types

- - - - - - - - - - - - - - - - - -
Reference typestd::iterator_traits<X>::referenceThe return type of dereferencing the iterator, which must be - T&.
Return Categorystd::return_category<X>::type - A type convertible to std::mutable_lvalue_iterator_tag -
- - - -

-


- - -

-Forward Traversal Iterator -

- -The Forward Iterator is an iterator that can be incremented. Also, it -is permissible to make multiple passes through the iterator's range. - -

Refinement of

- -Copy Constructible, -Assignable, -Default Constructible, and -Equality Comparable - - -

Associated types

- - - - - - - - - - - - - - -
Difference Typestd::iterator_traits<X>::difference_type - A signed integral type used for representing distances - between iterators that point into the same range. -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::forward_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Preincrement++i X&
Postincrementi++ convertible to const X&
- -

-


- - -

-Bidirectional Traversal Iterator -

- -An iterator that can be incremented and decremented. - -

Refinement of

- -Forward Traversal Iterator - -

Associated types

- - - - - - - -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::bidirectional_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Predecrement--i X&
Postdecrementi-- convertible to const X&
- -

-


- - -

-Random Access Traversal Iterator -

- -An iterator that provides constant-time methods for moving forward and -backward in arbitrary-sized steps. - -

Refinement of

- -Bidirectional Traversal Iterator and -Less Than Comparable where < is a total ordering - -

Associated types

- - - - - - - -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::random_access_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Iterator additioni += n X&
Iterator additioni + n or n + i X
Iterator subtractioni -= n X&
Iterator subtractioni - n X
Differencei - j std::iterator_traits<X>::difference_type
Element operatori[n]X must also be a model of - Readable Iterator. std::iterator_traits<X>::reference
Element assignmenti[n] = tX must also be a model of - Writable Iterator.unspecified
- -

- -


- - -
Copyright © 2000 -Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu) -
- - - diff --git a/include/boost/function_output_iterator.hpp b/include/boost/function_output_iterator.hpp deleted file mode 100644 index 764c118..0000000 --- a/include/boost/function_output_iterator.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// (C) Copyright Jeremy Siek 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. - -// Revision History: - -// 27 Feb 2001 Jeremy Siek -// Initial checkin. - -#ifndef BOOST_FUNCTION_OUTPUT_ITERATOR_HPP -#define BOOST_FUNCTION_OUTPUT_ITERATOR_HPP - -#include - -namespace boost { - - template - class function_output_iterator { - typedef function_output_iterator self; - public: - typedef std::output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - explicit function_output_iterator(const UnaryFunction& f = UnaryFunction()) - : m_f(f) {} - - struct output_proxy { - output_proxy(UnaryFunction& f) : m_f(f) { } - template output_proxy& operator=(const T& value) { - m_f(value); - return *this; - } - UnaryFunction& m_f; - }; - output_proxy operator*() { return output_proxy(m_f); } - self& operator++() { return *this; } - self& operator++(int) { return *this; } - private: - UnaryFunction m_f; - }; - - template - inline function_output_iterator - make_function_output_iterator(const UnaryFunction& f = UnaryFunction()) { - return function_output_iterator(f); - } - -} // namespace boost - -#endif // BOOST_FUNCTION_OUTPUT_ITERATOR_HPP diff --git a/include/boost/half_open_range.hpp b/include/boost/half_open_range.hpp deleted file mode 100644 index 1de1e9d..0000000 --- a/include/boost/half_open_range.hpp +++ /dev/null @@ -1,426 +0,0 @@ -// (C) Copyright Jeremy Siek and David Abrahams 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. -// -// Revision History: -// 11 Feb 2001 Use new iterator_adaptor interface, Fixes for Borland. -// (Dave Abrahams) -// 04 Feb 2001 Support for user-defined iterator categories (Dave Abrahams) -// 30 Jan 2001 Initial Checkin (Dave Abrahams) - -#ifndef BOOST_HALF_OPEN_RANGE_HPP_ -# define BOOST_HALF_OPEN_RANGE_HPP_ - -# include -# include -# include -# include -# include -# include -# include - -namespace boost { - -namespace detail { - - // Template class choose_finish -- allows us to maintain the invariant that - // start() <= finish() on half_open_range specializations that support random - // access. -#ifdef __MWERKS__ - template - const T& choose_finish(const T&, const T& finish, std::input_iterator_tag) - { - return finish; - } - - template - const T& choose_finish(const T&, const T& finish, std::output_iterator_tag) - { - return finish; - } - - template - const T& choose_finish(const T& start, const T& finish, std::random_access_iterator_tag) - { - return finish < start ? start : finish; - } -#else - template struct finish_chooser; - - template <> - struct finish_chooser - { - template - struct rebind - { - static T choose(const T&, const T& finish) - { return finish; } - }; - }; - - template <> - struct finish_chooser - { - template - struct rebind - { - static T choose(const T& start, const T& finish) - { return finish < start ? start : finish; } - }; - }; - - template - struct choose_finish - { - static const Incrementable choose(const Incrementable& start, const Incrementable& finish) - { - return finish_chooser<( - ::boost::is_convertible::value - )>::template rebind::choose(start, finish); - } - }; -#endif -} - -template -struct half_open_range -{ - typedef typename counting_iterator_generator::type iterator; - - private: // utility type definitions - // Using iter_t prevents compiler confusion with boost::iterator - typedef typename counting_iterator_generator::type iter_t; - - typedef std::less less_value; - typedef typename iter_t::iterator_category category; - typedef half_open_range self; - - public: - typedef iter_t const_iterator; - typedef typename counting_iterator_traits::value_type value_type; - typedef typename counting_iterator_traits::difference_type difference_type; - typedef typename counting_iterator_traits::reference reference; - typedef typename counting_iterator_traits::reference const_reference; - typedef typename counting_iterator_traits::pointer pointer; - typedef typename counting_iterator_traits::pointer const_pointer; - - // It would be nice to select an unsigned type, but this is appropriate - // since the library makes an attempt to select a difference_type which can - // hold the difference between any two iterators. - typedef typename counting_iterator_traits::difference_type size_type; - - half_open_range(Incrementable start, Incrementable finish) - : m_start(start), - m_finish( -#ifndef __MWERKS__ - detail::choose_finish::choose(start, finish) -#else - detail::choose_finish(start, finish, category()) -#endif - ) - {} - - // Implicit conversion from std::pair allows us - // to accept the results of std::equal_range(), for example. - half_open_range(const std::pair& x) - : m_start(x.first), - m_finish( -#ifndef __MWERKS__ - detail::choose_finish::choose(x.first, x.second) -#else - detail::choose_finish(x.first, x.second, category()) -#endif - ) - {} - - half_open_range& operator=(const self& x) - { - m_start = x.m_start; - m_finish = x.m_finish; - return *this; - } - - half_open_range& operator=(const std::pair& x) - { - m_start = x.first; - m_finish = -#ifndef __MWERKS__ - detail::choose_finish::choose(x.first, x.second); -#else - detail::choose_finish(x.first, x.second, category(); -#endif - } - - iterator begin() const { return iterator(m_start); } - iterator end() const { return iterator(m_finish); } - - Incrementable front() const { assert(!this->empty()); return m_start; } - Incrementable back() const { assert(!this->empty()); return boost::prior(m_finish); } - - Incrementable start() const { return m_start; } - Incrementable finish() const { return m_finish; } - - size_type size() const { return boost::detail::distance(begin(), end()); } - - bool empty() const - { - return m_finish == m_start; - } - - void swap(half_open_range& x) { - std::swap(m_start, x.m_start); - std::swap(m_finish, x.m_finish); - } - - public: // functions requiring random access elements - - // REQUIRES: x is reachable from this->front() - bool contains(const value_type& x) const - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - return !less_value()(x, m_start) && less_value()(x, m_finish); - } - - bool contains(const half_open_range& x) const - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - return x.empty() || !less_value()(x.m_start, m_start) && !less_value()(m_finish, x.m_finish); - } - - bool intersects(const half_open_range& x) const - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - return less_value()( - less_value()(this->m_start, x.m_start) ? x.m_start : this->m_start, - less_value()(this->m_finish, x.m_finish) ? this->m_finish : x.m_finish); - } - - half_open_range& operator&=(const half_open_range& x) - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - - if (less_value()(this->m_start, x.m_start)) - this->m_start = x.m_start; - - if (less_value()(x.m_finish, this->m_finish)) - this->m_finish = x.m_finish; - - if (less_value()(this->m_finish, this->m_start)) - this->m_start = this->m_finish; - - return *this; - } - - half_open_range& operator|=(const half_open_range& x) - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - - if (!x.empty()) - { - if (this->empty()) - { - *this = x; - } - else - { - if (less_value()(x.m_start, this->m_start)) - this->m_start = x.m_start; - - if (less_value()(this->m_finish, x.m_finish)) - this->m_finish = x.m_finish; - } - } - return *this; - } - - // REQUIRES: x is reachable from this->front() - const_iterator find(const value_type& x) const - { - BOOST_STATIC_ASSERT((boost::is_same::value)); - - return const_iterator(this->contains(x) ? x : m_finish); - } - - // REQUIRES: index >= 0 && index < size() - value_type operator[](size_type index) const - { - assert(index >= 0 && index < size()); - return m_start + index; - } - - value_type at(size_type index) const - { - if (index < 0 || index >= size()) - throw std::out_of_range(std::string("half_open_range")); - return m_start + index; - } - - private: // data members - Incrementable m_start, m_finish; -}; - -template -half_open_range operator|( - half_open_range x, - const half_open_range& y) -{ - return x |= y; -} - -template -half_open_range operator&( - half_open_range x, - const half_open_range& y) -{ - return x &= y; -} - -template -inline bool operator==( - const half_open_range& x, - const half_open_range& y) -{ - const bool y_empty = y.empty(); - return x.empty() ? y_empty : !y_empty && x.start() == y.start() && x.finish() == y.finish(); -} - -template -inline bool operator!=( - const half_open_range& x, - const half_open_range& y) -{ - return !(x == y); -} - -template -inline half_open_range -make_half_open_range(Incrementable first, Incrementable last) -{ - return half_open_range(first, last); -} - -template -bool intersects( - const half_open_range& x, - const half_open_range& y) -{ - return x.intersects(y); -} - -template -bool contains( - const half_open_range& x, - const half_open_range& y) -{ - return x.contains(y); -} - -} // namespace boost - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -namespace std { -template struct less > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - less cmp; - return !y.empty() && ( - cmp(x.start(), y.start()) - || !cmp(y.start(), x.start()) - && cmp(x.finish(), y.finish())); - } -}; - -template struct less_equal > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less cmp; - return !cmp(y,x); - } -}; -template struct greater > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less cmp; - return cmp(y,x); - } -}; - -template struct greater_equal > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less cmp; - return !cmp(x,y); - } -}; -} // namespace std - -#else - -namespace boost { -// Can't partially specialize std::less et al, so we must provide the operators -template -bool operator<(const half_open_range& x, - const half_open_range& y) -{ - return !y.empty() && ( - x.empty() || std::less()(x.start(), y.start()) - || !std::less()(y.start(), x.start()) - && std::less()(x.finish(), y.finish())); -} - -template -bool operator>(const half_open_range& x, - const half_open_range& y) -{ - return y < x; -} - -template -bool operator<=(const half_open_range& x, - const half_open_range& y) -{ - return !(y < x); -} - -template -bool operator>=(const half_open_range& x, - const half_open_range& y) -{ - return !(x < y); -} -} // namespace boost - -#endif - - -#endif // BOOST_HALF_OPEN_RANGE_HPP_ diff --git a/include/boost/iterator.hpp b/include/boost/iterator.hpp deleted file mode 100644 index 0e2ef72..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 -{ -# if defined(BOOST_NO_STD_ITERATOR) && !defined(BOOST_MSVC_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 e1b8720..0000000 --- a/include/boost/pending/integer_range.hpp +++ /dev/null @@ -1,59 +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. -// -// 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 -#include - -namespace boost { - -//============================================================================= -// Counting Iterator and Integer Range Class - -template -struct integer_range { - typedef typename counting_iterator_generator::type iterator; - - 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 - -#endif // BOOST_INTEGER_RANGE_HPP_ diff --git a/include/boost/pending/iterator_adaptors.hpp b/include/boost/pending/iterator_adaptors.hpp deleted file mode 100644 index 548b9ba..0000000 --- a/include/boost/pending/iterator_adaptors.hpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp deleted file mode 100644 index c3c3601..0000000 --- a/include/boost/pending/iterator_tests.hpp +++ /dev/null @@ -1,214 +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. -// -// Revision History: -// 08 Feb 2001 Fixed bidirectional iterator test so that -// --i is no longer a precondition. -// (Jeremy Siek) -// 04 Feb 2001 Added lvalue test, corrected preconditions -// (David Abrahams) - -# include -# include -# include -# include -# include // for detail::dummy_constructor - -namespace boost { - - // use this for the value type -struct dummyT { - dummyT() { } - dummyT(detail::dummy_constructor) { } - 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 struct lvalue_test -{ - template static void check(Iterator) - { -# ifndef BOOST_NO_STD_ITERATOR_TRAITS - typedef typename std::iterator_traits::reference reference; - typedef typename std::iterator_traits::value_type value_type; -# else - typedef typename Iterator::reference reference; - typedef typename Iterator::value_type value_type; -# endif - BOOST_STATIC_ASSERT(boost::is_reference::value); - BOOST_STATIC_ASSERT((boost::is_same::value - || boost::is_same::value - )); - } -}; - -# ifdef BOOST_NO_STD_ITERATOR_TRAITS -template <> struct lvalue_test { - template static void check(T) {} -}; -#endif - -template -void forward_iterator_test(Iterator i, T v1, T v2) -{ - input_iterator_test(i, v1, v2); - - // borland doesn't allow non-type template parameters -# if !defined(__BORLANDC__) || (__BORLANDC__ > 0x551) - lvalue_test<(boost::is_pointer::value)>::check(i); -#endif -} - -// Preconditions: *i == v1, *++i == v2 -template -void bidirectional_iterator_test(Iterator i, T v1, T v2) -{ - forward_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