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/doc/BidirectionalTraversal.html b/doc/BidirectionalTraversal.html index 5bc8342..9de555e 100644 --- a/doc/BidirectionalTraversal.html +++ b/doc/BidirectionalTraversal.html @@ -3,333 +3,48 @@ - + Bidirectional Traversal Concept - + -

Bidirectional Traversal Concept

- - - -

A class or built-in type X models the Bidirectional Traversal -concept if, in addition to X meeting the requirements of Forward +

+

A class or built-in type X models the Bidirectional Traversal +concept if, in addition to X meeting the requirements of Forward Traversal Iterator, the following expressions are valid and respect the stated semantics.

- +
- - - - + + - - + + +--(++r) == r. +--r == --s +implies r == +s. &r == &--r. - - + + + +bidirectional_traversal_tag
Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal +
Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal Iterator)
ExpressionReturn TypeAssertion/Semantics / +
ExpressionReturn TypeAssertion/Semantics / Pre-/Post-condition
--rX&
--rX& pre: there exists -s such that r +s such that r == ++s. post: -s is +s is dereferenceable. ---(++r) == r. ---r == --s -implies r == -s. &r == &--r.
r--convertible to const X&
r--convertible to const X&
 {
   X tmp = r;
@@ -339,13 +54,18 @@ implies r iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -bidirectional_traversal_tag  
+ + diff --git a/doc/BidirectionalTraversal.rst b/doc/BidirectionalTraversal.rst index a62b8bd..8655c63 100755 --- a/doc/BidirectionalTraversal.rst +++ b/doc/BidirectionalTraversal.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Bidirectional Traversal Concept ............................... diff --git a/doc/ForwardTraversal.html b/doc/ForwardTraversal.html index 934aa56..80447aa 100644 --- a/doc/ForwardTraversal.html +++ b/doc/ForwardTraversal.html @@ -3,340 +3,60 @@ - + Forward Traversal Concept - + -

Forward Traversal Concept

- - - -

A class or built-in type X models the Forward Traversal -concept if, in addition to X meeting the requirements of Default +

+

A class or built-in type X models the Forward Traversal +concept if, in addition to X meeting the requirements of Default Constructible and Single Pass Iterator, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - - + + - - - + + +++r == ++s. - + - + +forward_traversal_tag
Forward Traversal Iterator Requirements (in addition to Default Constructible and Single Pass Iterator)
Forward Traversal Iterator Requirements (in addition to Default Constructible and Single Pass Iterator)
ExpressionReturn TypeAssertion/Note
ExpressionReturn TypeAssertion/Note
X u;X&note: u may have a +
X u;X&note: u may have a singular value.
++rX&r == s and r is +
++rX&r == s and r is dereferenceable implies -++r == ++s.
iterator_traits<X>::difference_type
iterator_traits<X>::difference_type A signed integral type representing the distance between iterators  
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -forward_traversal_tag  
+ + diff --git a/doc/ForwardTraversal.rst b/doc/ForwardTraversal.rst index 80dd9c7..c4156d5 100755 --- a/doc/ForwardTraversal.rst +++ b/doc/ForwardTraversal.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Forward Traversal Concept ......................... diff --git a/doc/IncrementableIterator.html b/doc/IncrementableIterator.html index c42cfff..0544d22 100644 --- a/doc/IncrementableIterator.html +++ b/doc/IncrementableIterator.html @@ -3,323 +3,38 @@ - + Incrementable Iterator Concept - + -

Incrementable Iterator Concept

- - - -

A class or built-in type X models the Incrementable Iterator -concept if, in addition to X being Assignable and Copy +

+

A class or built-in type X models the Incrementable Iterator +concept if, in addition to X being Assignable and Copy Constructible, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - - + + + - - + + - + +incrementable_traversal_tag
Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible)
Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible)
ExpressionReturn TypeAssertion/Semantics
ExpressionReturn TypeAssertion/Semantics
++rX&&r == &++r
++rX&&r == &++r
r++X
r++X
 {
    X tmp = r;
@@ -329,13 +44,18 @@ stated semantics.

iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -incrementable_traversal_tag  
+ + diff --git a/doc/IncrementableIterator.rst b/doc/IncrementableIterator.rst index a1f92ec..f14928e 100755 --- a/doc/IncrementableIterator.rst +++ b/doc/IncrementableIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Incrementable Iterator Concept .............................. diff --git a/doc/InteroperableIterator.rst b/doc/InteroperableIterator.rst index 3632ff2..0cb751e 100644 --- a/doc/InteroperableIterator.rst +++ b/doc/InteroperableIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Interoperable Iterator Concept .............................. diff --git a/doc/LvalueIterator.html b/doc/LvalueIterator.html index 6575694..29b3187 100644 --- a/doc/LvalueIterator.html +++ b/doc/LvalueIterator.html @@ -3,329 +3,49 @@ - + Lvalue Iterator Concept - + -

Lvalue Iterator Concept

- - - +

The Lvalue Iterator concept adds the requirement that the return -type of operator* type be a reference to the value type of the +type of operator* type be a reference to the value type of the iterator.

- +
- + - - - + + + - - - + + +pre: a is +dereferenceable. If a +== b then *a is +equivalent to *b.
Lvalue Iterator Requirements
Lvalue Iterator Requirements
ExpressionReturn TypeNote/Assertion
ExpressionReturn TypeNote/Assertion
*aT&T is cv -iterator_traits<X>::value_type +
*aT&T is cv +iterator_traits<X>::value_type where cv is an optional cv-qualification. -pre: a is -dereferenceable. If a -== b then *a is -equivalent to *b.
+ + diff --git a/doc/LvalueIterator.rst b/doc/LvalueIterator.rst index 39c2672..46c61b1 100755 --- a/doc/LvalueIterator.rst +++ b/doc/LvalueIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Lvalue Iterator Concept ....................... diff --git a/doc/RandomAccessTraversal.html b/doc/RandomAccessTraversal.html index 4dd09ca..761ab0d 100644 --- a/doc/RandomAccessTraversal.html +++ b/doc/RandomAccessTraversal.html @@ -3,304 +3,19 @@ - + Random Access Traversal Concept - + -

Random Access Traversal Concept

- - - -

A class or built-in type X models the Random Access Traversal +

+

A class or built-in type X models the Random Access Traversal concept if the following expressions are valid and respect the stated -semantics. In the table below, Distance is -iterator_traits<X>::difference_type and n represents a -constant object of type Distance.

- +semantics. In the table below, Distance is +iterator_traits<X>::difference_type and n represents a +constant object of type Distance.

+
@@ -308,18 +23,18 @@ constant object of type Distance< - + - - - - + + + - - + + - - - + + - - - + + + - - - + + - - - + + - + - + - + - + - - - - + + + - - - - + + + - - - + + + - - - + + + - + +random_access_traversal_tag
Random Access Traversal Iterator Requirements (in addition to Bidirectional Traversal)
Random Access Traversal Iterator Requirements (in addition to Bidirectional Traversal)
ExpressionReturn TypeOperational SemanticsAssertion/ +
ExpressionReturn TypeOperational SemanticsAssertion/ Precondition
r += nX&
r += nX&
 {
   Distance m = n;
@@ -335,75 +50,80 @@ Precondition
 
 
a + n, n + aX{ X tmp = a; return tmp +
a + n, n + aX{ X tmp = a; return tmp += n; }  
r -= nX&return r += -n
r -= nX&return r += -n  
a - nX{ X tmp = a; return tmp +
a - nX{ X tmp = a; return tmp -= n; }  
b - aDistancea < b ?  distance(a,b) +
b - aDistancea < b ?  distance(a,b) : -distance(b,a) pre: there exists a -value n of -Distance such that -a + n == b. b +value n of +Distance such that +a + n == b. b == a + (b - a).
a[n]
a[n] convertible to T*(a + n)*(a + n) pre: a is a Readable Iterator
a[n] = v
a[n] = v convertible to T*(a + n) = v*(a + n) = v pre: a is a Writable iterator
a < bconvertible to boolb - a > 0< is a total +
a < bconvertible to boolb - a > 0< is a total ordering relation
a > bconvertible to boolb < a> is a total +
a > bconvertible to boolb < a> is a total ordering relation
a >= bconvertible to bool!(a < b)
a >= bconvertible to bool!(a < b)  
a <= bconvertible to bool!(a > b)
a <= bconvertible to bool!(a > b)  
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -random_access_traversal_tag   
+ + diff --git a/doc/RandomAccessTraversal.rst b/doc/RandomAccessTraversal.rst index 490faf6..97b0f3d 100644 --- a/doc/RandomAccessTraversal.rst +++ b/doc/RandomAccessTraversal.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Random Access Traversal Concept ............................... diff --git a/doc/ReadableIterator.html b/doc/ReadableIterator.html index b6873c4..df231d3 100644 --- a/doc/ReadableIterator.html +++ b/doc/ReadableIterator.html @@ -3,337 +3,57 @@ - + Readable Iterator Concept - + -

Readable Iterator Concept

- - - -

A class or built-in type X models the Readable Iterator concept -for value type T if, in addition to X being Assignable and +

+

A class or built-in type X models the Readable Iterator concept +for value type T if, in addition to X being Assignable and Copy Constructible, the following expressions are valid and respect -the stated semantics. U is the type of any specified member of -type T.

- +the stated semantics. U is the type of any specified member of +type T.

+
- + - - - + + + - - + + - - - + + - - - + + +
Readable Iterator Requirements (in addition to Assignable and Copy Constructible)
Readable Iterator Requirements (in addition to Assignable and Copy Constructible)
ExpressionReturn TypeNote/Precondition
ExpressionReturn TypeNote/Precondition
iterator_traits<X>::value_typeT
iterator_traits<X>::value_typeT Any non-reference, non-cv-qualified type
*aConvertible to T
-
pre: a is dereferenceable. If a == b then *a
-
is equivalent to *b.
+
*aConvertible to T
+
pre: a is dereferenceable. If a == b then *a
+
is equivalent to *b.
a->mU&pre: pre: (*a).m is well-defined. Equivalent to (*a).m.
a->mU&pre: pre: (*a).m is well-defined. Equivalent to (*a).m.
+ + diff --git a/doc/ReadableIterator.rst b/doc/ReadableIterator.rst index 27f79f8..d38dad5 100755 --- a/doc/ReadableIterator.rst +++ b/doc/ReadableIterator.rst @@ -1,6 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Readable Iterator Concept ......................... diff --git a/doc/SinglePassIterator.html b/doc/SinglePassIterator.html index 9a725e7..bd176d8 100644 --- a/doc/SinglePassIterator.html +++ b/doc/SinglePassIterator.html @@ -3,341 +3,61 @@ - + Single Pass Iterator Concept - + -

Single Pass Iterator Concept

- - - -

A class or built-in type X models the Single Pass Iterator +

+

A class or built-in type X models the Single Pass Iterator concept if the following expressions are valid and respect the stated semantics.

- +
- - - - + + - - - + + +r is dereferenceable or +r is past-the-end - - - + + - - - + + + - + +single_pass_traversal_tag
Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality +
Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality Comparable)
ExpressionReturn TypeAssertion/Semantics / +
ExpressionReturn TypeAssertion/Semantics / Pre-/Post-condition
++rX&pre: r is +
++rX&pre: r is dereferenceable; post: -r is dereferenceable or -r is past-the-end
a == bconvertible to bool== is an equivalence +
a == bconvertible to bool== is an equivalence relation over its domain
a != bconvertible to bool!(a == b)
a != bconvertible to bool!(a == b)
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -single_pass_traversal_tag  
+ + diff --git a/doc/SinglePassIterator.rst b/doc/SinglePassIterator.rst index eaa50e0..2754d97 100755 --- a/doc/SinglePassIterator.rst +++ b/doc/SinglePassIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Single Pass Iterator Concept ............................ diff --git a/doc/SwappableIterator.html b/doc/SwappableIterator.html index c11b570..7478e5f 100644 --- a/doc/SwappableIterator.html +++ b/doc/SwappableIterator.html @@ -3,327 +3,47 @@ - + Swappable Iterator Concept - + -

Swappable Iterator Concept

- - - -

A class or built-in type X models the Swappable Iterator concept -if, in addition to X being Copy Constructible, the following +

+

A class or built-in type X models the Swappable Iterator concept +if, in addition to X being Copy Constructible, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - + +
Swappable Iterator Requirements (in addition to Copy Constructible)
Swappable Iterator Requirements (in addition to Copy Constructible)
ExpressionReturn TypePostcondition
ExpressionReturn TypePostcondition
iter_swap(a, b)void
iter_swap(a, b)void the pointed to values are exchanged
-
+
[Note: An iterator that is a model of the Readable and Writable Iterator concepts
is also a model of Swappable Iterator. --end note]
+ + diff --git a/doc/SwappableIterator.rst b/doc/SwappableIterator.rst index 55554e7..ec94d32 100755 --- a/doc/SwappableIterator.rst +++ b/doc/SwappableIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Swappable Iterator Concept .......................... diff --git a/doc/WritableIterator.html b/doc/WritableIterator.html index 76d621d..c3676bf 100644 --- a/doc/WritableIterator.html +++ b/doc/WritableIterator.html @@ -3,325 +3,45 @@ - + Writable Iterator Concept - + -

Writable Iterator Concept

- - - -

A class or built-in type X models the Writable Iterator concept -if, in addition to X being Copy Constructible, the following +

+

A class or built-in type X models the Writable Iterator concept +if, in addition to X being Copy Constructible, the following expressions are valid and respect the stated semantics. Writable Iterators have an associated set of value types.

- +
- + - - - + + + - + - +value types of X
Writable Iterator Requirements (in addition to Copy Constructible)
Writable Iterator Requirements (in addition to Copy Constructible)
ExpressionReturn TypePrecondition
ExpressionReturn TypePrecondition
*a = o
*a = o  pre: The type of o +pre: The type of o is in the set of -value types of X
+ + diff --git a/doc/WritableIterator.rst b/doc/WritableIterator.rst index 49b6e16..7b854cc 100755 --- a/doc/WritableIterator.rst +++ b/doc/WritableIterator.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Writable Iterator Concept ......................... diff --git a/doc/counting_iterator.html b/doc/counting_iterator.html index 63136f0..8faa043 100644 --- a/doc/counting_iterator.html +++ b/doc/counting_iterator.html @@ -3,295 +3,13 @@ - + Counting Iterator - +
@@ -314,9 +32,6 @@ Railway Operation and Construction Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. - - - @@ -329,9 +44,6 @@ The counting iterator adaptor adds this crucial piece of functionality to whatever type it wraps. One can use the counting iterator adaptor not only with integer types, but with any incrementable type.

- - -

counting_iterator adapts an object by adding an operator* that returns the current value of the object. All other iterator operations are forwarded to the adapted object.

@@ -339,8 +51,8 @@ are forwarded to the adapted object.

-
-

Table of Contents

+
+

Table of Contents

-
-

counting_iterator synopsis

- - - +
+

counting_iterator synopsis

 template <
     class Incrementable
@@ -393,7 +102,7 @@ else if (numeric_limits<Incrementable>::is_specialized)
         random_access_traversal_tag, Incrementable, const Incrementable&)
 else
     return iterator-category(
-         iterator_traversal<Incrementable>::type,
+         iterator_traversal<Incrementable>::type, 
          Incrementable, const Incrementable&)
 
@@ -403,8 +112,8 @@ the cases where std::numeric_limi is true.]
-
-

counting_iterator requirements

+
+

counting_iterator requirements

The Incrementable argument shall be Copy Constructible and Assignable.

If iterator_category is convertible to forward_iterator_tag or forward_traversal_tag, the following must be well-formed:

@@ -429,8 +138,8 @@ n = i - j; i < j;
-
-

counting_iterator models

+
+

counting_iterator models

Specializations of counting_iterator model Readable Lvalue Iterator. In addition, they model the concepts corresponding to the iterator tags to which their iterator_category is convertible. @@ -445,8 +154,8 @@ concepts modeled by Incrementable counting_iterator<Y,C2,D2> if and only if X is interoperable with Y.

-
-

counting_iterator operations

+
+

counting_iterator operations

In addition to the operations required by the concepts modeled by counting_iterator, counting_iterator provides the following operations.

@@ -519,9 +228,6 @@ operations.

- - -
 template <class Incrementable>
 counting_iterator<Incrementable> make_counting_iterator(Incrementable x);
@@ -535,12 +241,9 @@ with current construc
 
 
 
-
-
-
 
-
-

Example

+
+

Example

This example fills an array with numbers and a second array with pointers into the first array, using counting_iterator for both tasks. Finally indirect_iterator is used to print out the numbers @@ -558,7 +261,7 @@ std::copy(boost::make_counting_iterator(numbers.begin()), boost::make_counting_iterator(numbers.end()), std::back_inserter(pointers)); -std::cout << "indirectly printing out the numbers from 0 to " +std::cout << "indirectly printing out the numbers from 0 to " << N << std::endl; std::copy(boost::make_indirect_iterator(pointers.begin()), boost::make_indirect_iterator(pointers.end()), @@ -568,10 +271,15 @@ std::cout << std::endl;

The output is:

 indirectly printing out the numbers from 0 to 7
-0 1 2 3 4 5 6
+0 1 2 3 4 5 6 
 

The source code for this example can be found here.

+ + diff --git a/doc/counting_iterator.rst b/doc/counting_iterator.rst index ff7da3c..191011a 100644 --- a/doc/counting_iterator.rst +++ b/doc/counting_iterator.rst @@ -1,7 +1,3 @@ -.. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - +++++++++++++++++++ Counting Iterator +++++++++++++++++++ diff --git a/doc/counting_iterator_abstract.rst b/doc/counting_iterator_abstract.rst index 117b94e..bdb8491 100644 --- a/doc/counting_iterator_abstract.rst +++ b/doc/counting_iterator_abstract.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - ``counting_iterator`` adapts an object by adding an ``operator*`` that returns the current value of the object. All other iterator operations are forwarded to the adapted object. diff --git a/doc/counting_iterator_eg.rst b/doc/counting_iterator_eg.rst index b64562d..5f6b3b3 100644 --- a/doc/counting_iterator_eg.rst +++ b/doc/counting_iterator_eg.rst @@ -1,6 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Example ....... diff --git a/doc/counting_iterator_ref.rst b/doc/counting_iterator_ref.rst index 1c5fd1c..bc94db7 100644 --- a/doc/counting_iterator_ref.rst +++ b/doc/counting_iterator_ref.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - :: template < diff --git a/doc/facade-and-adaptor.diff b/doc/facade-and-adaptor.diff new file mode 100755 index 0000000..07f0e40 --- /dev/null +++ b/doc/facade-and-adaptor.diff @@ -0,0 +1,228 @@ +Index: facade-and-adaptor.rst +=================================================================== +RCS file: /cvsroot/boost/boost/libs/iterator/doc/facade-and-adaptor.rst,v +retrieving revision 1.9 +retrieving revision 1.14 +diff -b -d -u -r1.9 -r1.14 +--- facade-and-adaptor.rst 22 Sep 2003 19:55:00 -0000 1.9 ++++ facade-and-adaptor.rst 18 Jan 2004 15:51:06 -0000 1.14 +@@ -3,17 +3,25 @@ None + +++++++++++++++++++++++++++++ + + :Author: David Abrahams, Jeremy Siek, Thomas Witt +-:Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@acm.org ++:Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@styleadvisor.com + :organization: `Boost Consulting`_, Indiana University `Open Systems +- Lab`_, University of Hanover `Institute for Transport +- Railway Operation and Construction`_ +-:date: $Date: 2004/01/18 19:56:39 $ +-:Number: N1530=03-0113 ++ Lab`_, `Zephyr Associates, Inc.`_ ++:date: $Date: 2004/01/18 19:56:39 $ ++ ++:Number: This is a revised version of N1530_\ =03-0113, which was ++ accepted for Technical Report 1 by the C++ standard ++ committee's library working group. ++ ++.. Version 1.9 of this ReStructuredText document corresponds to ++ n1530_, the paper accepted by the LWG. ++ ++.. _n1530: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1530.html ++ + :copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved + + .. _`Boost Consulting`: http://www.boost-consulting.com + .. _`Open Systems Lab`: http://www.osl.iu.edu +-.. _`Institute for Transport Railway Operation and Construction`: http://www.ive.uni-hannover.de ++.. _`Zephyr Associates, Inc.`: http://www.styleadvisor.com + + :abstract: We propose a set of class templates that help programmers + build standard-conforming iterators, both from scratch and +@@ -124,15 +132,15 @@ None + ================= + + This proposal is formulated in terms of the new ``iterator concepts`` +-as proposed in `n1477`_, since user-defined and especially adapted ++as proposed in n1550_, since user-defined and especially adapted + iterators suffer from the well known categorization problems that are + inherent to the current iterator categories. + +-.. _`n1477`: http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1477.html ++.. _n1550: http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html + +-This proposal does not strictly depend on proposal `n1477`_, as there ++This proposal does not strictly depend on proposal n1550_, as there + is a direct mapping between new and old categories. This proposal +-could be reformulated using this mapping if `n1477`_ was not accepted. ++could be reformulated using this mapping if n1550_ was not accepted. + + Interoperability + ================ +@@ -141,24 +149,24 @@ None + current standard. There are currently two defect reports that are + concerned with interoperability issues. + +-Issue `179`_ concerns the fact that mutable container iterator types ++Issue 179_ concerns the fact that mutable container iterator types + are only required to be convertible to the corresponding constant + iterator types, but objects of these types are not required to + interoperate in comparison or subtraction expressions. This situation + is tedious in practice and out of line with the way built in types + work. This proposal implements the proposed resolution to issue +-`179`_, as most standard library implementations do nowadays. In other ++179_, as most standard library implementations do nowadays. In other + words, if an iterator type A has an implicit or user defined + conversion to an iterator type B, the iterator types are interoperable + and the usual set of operators are available. + +-Issue `280`_ concerns the current lack of interoperability between ++Issue 280_ concerns the current lack of interoperability between + reverse iterator types. The proposed new reverse_iterator template + fixes the issues raised in 280. It provides the desired + interoperability without introducing unwanted overloads. + +-.. _`179`: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#179 +-.. _`280`: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#280 ++.. _179: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#179 ++.. _280: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#280 + + + Iterator Facade +@@ -195,7 +203,7 @@ None + * ``filter_iterator``, which provides a view of an iterator range in + which some elements of the underlying range are skipped. + +-.. _counting_iterator: ++.. _counting: + + * ``counting_iterator``, which adapts any incrementable type + (e.g. integers, iterators) so that incrementing/decrementing the +@@ -226,15 +234,13 @@ Issue 9.1 et al + :: + + struct use_default; +- const unsigned use_default_access = -1; + + struct iterator_core_access { /* implementation detail */ }; + + template < + class Derived + , class Value +- , unsigned AccessCategory +- , class TraversalCategory ++ , class CategoryOrTraversal + , class Reference = Value& + , class Difference = ptrdiff_t + > +@@ -244,8 +250,7 @@ Issue 9.1 et al. + class Derived + , class Base + , class Value = use_default +- , unsigned Access = use_default_access +- , class Traversal = use_default ++ , class CategoryOrTraversal = use_default + , class Reference = use_default + , class Difference = use_default + > +@@ -254,10 +259,9 @@ Issue 9.1 et al. + template < + class Iterator + , class Value = use_default +- , unsigned Access = use_default_access +- , class Traversal = use_default ++ , class CategoryOrTraversal = use_default + , class Reference = use_default + , class Difference = use_default + > + class indirect_iterator; + +Issue 9.44y + ++ template ++ struct pointee; ++ ++ template ++ struct indirect_reference; ++ + template + class reverse_iterator; + +@@ -277,8 +287,7 @@ Issue 9.1 et al. + + template < + class Incrementable +- , unsigned Access = use_default_access +- , class Traversal = use_default ++ , class CategoryOrTraversal = use_default + , class Difference = use_default + > + class counting_iterator +@@ -312,17 +321,35 @@ Issue 9.8 + Specialized adaptors [lib.iterator.special.adaptors] + ==================================================== + +-.. The requirements for all of these need to be written *much* more +- formally -DWA +- + +-[*Note:* The ``enable_if_convertible::type`` expression used in ++The ``enable_if_convertible::type`` expression used in + this section is for exposition purposes. The converting constructors + for specialized adaptors should be only be in an overload set provided + that an object of type ``X`` is implicitly convertible to an object of +-type ``Y``. The ``enable_if_convertible`` approach uses SFINAE to ++type ``Y``. ++The signatures involving ``enable_if_convertible`` should behave ++*as-if* ``enable_if_convertible`` were defined to be:: ++ ++ template enable_if_convertible_impl ++ {}; ++ ++ template <> enable_if_convertible_impl ++ { struct type; }; ++ ++ template ++ struct enable_if_convertible ++ : enable_if_convertible_impl::value> ++ {}; ++ ++If an expression other than the default argument is used to supply ++the value of a function parameter whose type is written in terms ++of ``enable_if_convertible``, the program is ill-formed, no ++diagnostic required. ++ ++[*Note:* The ``enable_if_convertible`` approach uses SFINAE to + take the constructor out of the overload set when the types are not +-implicitly convertible.] ++implicitly convertible. ++] + + + Indirect iterator +@@ -330,6 +357,16 @@ Issue 9.44y + + .. include:: indirect_iterator_abstract.rst + ++Class template ``pointee`` ++.................................... ++ ++.. include:: pointee_ref.rst ++ ++Class template ``indirect_reference`` ++..................................... ++ ++.. include:: indirect_reference_ref.rst ++ + Class template ``indirect_iterator`` + .................................... + +@@ -393,8 +430,7 @@ + + + +-.. +- LocalWords: Abrahams Siek Witt istream ostream iter MTL strided interoperate ++.. LocalWords: Abrahams Siek Witt istream ostream iter MTL strided interoperate + LocalWords: CRTP metafunctions inlining lvalue JGS incrementable BGL LEDA cv + LocalWords: GraphBase struct ptrdiff UnaryFunction const int typename bool pp + LocalWords: lhs rhs SFINAE markup iff tmp OtherDerived OtherIterator DWA foo diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index d2199e6..10049b7 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -3,294 +3,12 @@ - + Iterator Facade and Adaptor - +
@@ -314,9 +32,6 @@ committee's library working group. - - - @@ -337,8 +52,8 @@ by adapting other iterators.
-
-

Table of Contents

+
+

Table of Contents

-
-

Motivation

+
+

Motivation

Iterators play an important role in modern C++ programming. The iterator is the central abstraction of the algorithms of the Standard Library, allowing algorithms to be re-used in in a wide variety of @@ -510,16 +225,16 @@ of more specialized adaptors, such as the

-
-

Impact on the Standard

+
+

Impact on the Standard

This proposal is purely an addition to the C++ standard library. However, note that this proposal relies on the proposal for New Iterator Concepts.

-
-

Design

-
-

Iterator Concepts

+
+

Design

+
+

Iterator Concepts

This proposal is formulated in terms of the new iterator concepts as proposed in n1550, since user-defined and especially adapted iterators suffer from the well known categorization problems that are @@ -528,8 +243,8 @@ inherent to the current iterator categories.

is a direct mapping between new and old categories. This proposal could be reformulated using this mapping if n1550 was not accepted.

-
-

Interoperability

+
+

Interoperability

The question of iterator interoperability is poorly addressed in the current standard. There are currently two defect reports that are concerned with interoperability issues.

@@ -548,14 +263,11 @@ reverse iterator types. The proposed new reverse_iterator template fixes the issues raised in 280. It provides the desired interoperability without introducing unwanted overloads.

-
-

Iterator Facade

- - - +
+

Iterator Facade

- +

While the iterator interface is rich, there is a core subset of the interface that is necessary for all the functionality. We have identified the following core behaviors for iterators:

@@ -595,8 +307,8 @@ iterators, and a separate iterato impossible. -
-

Usage

+
+

Usage

The user of iterator_facade derives his iterator class from a specialization of iterator_facade and passes the derived iterator class as iterator_facade's first template parameter. @@ -619,8 +331,8 @@ requirements.

-Expression -Effects +Expression +Effects @@ -659,8 +371,8 @@ constructor. Finally, if the iterator is to model Forward Traversal Iterator or a more-refined iterator concept, a default constructor is required.

-
-

Iterator Core Access

+
+

Iterator Core Access

iterator_facade and the operator implementations need to be able to access the core member functions in the derived class. Making the core member functions public would expose an implementation detail to @@ -683,7 +395,7 @@ provided, a class that acts as a gateway to the core member functions in the derived iterator class. The author of the derived class only needs to grant friendship to iterator_core_access to make his core member functions available to the library.

- +

iterator_core_access will be typically implemented as an empty class containing only private static member functions which invoke the @@ -693,8 +405,8 @@ standardize the gateway protocol. Note that even if open a safety loophole, as every core member function preserves the invariants of the iterator.

-
-

operator[]

+
+

operator[]

The indexing operator for a generalized iterator presents special challenges. A random access iterator's operator[] is only required to return something convertible to its value_type. @@ -716,8 +428,8 @@ the implementation of her iterator is free to implement an class; it will hide the one supplied by iterator_facade from clients of her iterator.

-
-

operator->

+
+

operator->

The reference type of a readable iterator (and today's input iterator) need not in fact be a reference, so long as it is convertible to the iterator's value_type. When the value_type @@ -738,14 +450,11 @@ Patterns, C++ Report, February 1995, pp. 24-27.

-
-

Iterator Adaptor

- - - +
+

Iterator Adaptor

- +

The iterator_adaptor class template adapts some Base [3] type to create a new iterator. Instantiations of iterator_adaptor are derived from a corresponding instantiation of iterator_facade @@ -782,8 +491,8 @@ template parameter may not always be identical to the iterator's reference type, and will keep users from making mistakes based on that assumption.

-
-

Specialized Adaptors

+
+

Specialized Adaptors

This proposal also contains several examples of specialized adaptors which were easily implemented using iterator_adaptor:

    @@ -798,7 +507,7 @@ to the underlying values when dereferenced.
  • filter_iterator, which provides a view of an iterator range in which some elements of the underlying range are skipped.
-
    +
    • counting_iterator, which adapts any incrementable type (e.g. integers, iterators) so that incrementing/decrementing the adapted iterator and dereferencing it produces successive values of @@ -816,10 +525,10 @@ and Stanford GraphBase [8], to the BGL interface (which requires C++ Standard compliant iterators).

-
-

Proposed Text

-
-

Header <iterator_helper> synopsis [lib.iterator.helper.synopsis]

+
+

Proposed Text

+
+

Header <iterator_helper> synopsis [lib.iterator.helper.synopsis]

 struct use_default;
 
@@ -884,22 +593,16 @@ template <class UnaryFunction>
 class function_output_iterator;
 
-
-

Iterator facade [lib.iterator.facade]

- - - +
+

Iterator facade [lib.iterator.facade]

iterator_facade is a base class template that implements the interface of standard iterators in terms of a few core functions and associated types, to be supplied by a derived iterator class.

-
-

Class template iterator_facade

- - - +
+

Class template iterator_facade

- +
 template <
     class Derived
@@ -983,12 +686,12 @@ template <class Dr, class V, class TC, class R, class D>
 Derived operator+ (typename Derived::difference_type n,
                    iterator_facade<Dr,V,TC,R,D> const&);
 
-

The iterator_category member of iterator_facade is

+

The iterator_category member of iterator_facade is

 iterator-category(CategoryOrTraversal, value_type, reference)
 

where iterator-category is defined as follows:

-
+
 iterator-category(C,R,V) :=
    if (C is convertible to std::input_iterator_tag
        || C is convertible to std::output_iterator_tag
@@ -1035,10 +738,10 @@ traversal tags would add no information]

The enable_if_interoperable template used above is for exposition purposes. The member operators should only be in an overload set -provided the derived types Dr1 and Dr2 are interoperable, +provided the derived types Dr1 and Dr2 are interoperable, meaning that at least one of the types is convertible to the other. The enable_if_interoperable approach uses SFINAE to take the operators -out of the overload set when the types are not interoperable. +out of the overload set when the types are not interoperable. The operators should behave as-if enable_if_interoperable were defined to be:

@@ -1057,8 +760,8 @@ struct enable_if_interoperable
 {};
 
-
-

iterator_facade Requirements

+
+

iterator_facade Requirements

The following table describes the typical valid expressions on iterator_facade's Derived parameter, depending on the iterator concept(s) it will model. The operations in the first @@ -1071,8 +774,8 @@ object of type X, X, and z is a constant object of a random access traversal iterator type interoperable with X.

-
-

iterator_facade Core Operations

+
+

iterator_facade Core Operations

@@ -1081,10 +784,10 @@ interoperable with X. - - - - + + + @@ -1131,8 +834,8 @@ Iterator
ExpressionReturn TypeAssertion/NoteUsed to implement Iterator +
ExpressionReturn TypeAssertion/NoteUsed to implement Iterator Concept(s)
-
-

iterator_facade operations

+
+

iterator_facade operations

The operations in this section are described in terms of operations on the core interface of Derived which may be inaccessible (i.e. private). The implementation should access these operations @@ -1156,14 +859,14 @@ of type pointer equal

 &static_cast<Derived const*>(this)->dereference()
 
-

Otherwise returns an object of unspecified type such that, +

Otherwise returns an object of unspecified type such that, (*static_cast<Derived const*>(this))->m is equivalent to (w = **static_cast<Derived const*>(this), w.m) for some temporary object w of type value_type.

-

unspecified operator[](difference_type n) const;

+

unspecified operator[](difference_type n) const;

@@ -1304,12 +1007,10 @@ operator ==(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1328,12 +1029,10 @@ operator !=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1352,12 +1051,10 @@ operator <(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1376,12 +1073,10 @@ operator <=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1400,12 +1095,10 @@ operator >(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1424,18 +1117,16 @@ operator >=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

((Dr1 const&)lhs).equal((Dr2 const&)rhs).

-
-
Otherwise,
-

((Dr2 const&)rhs).equal((Dr1 const&)lhs).

-
+
then
+
((Dr1 const&)lhs).equal((Dr2 const&)rhs).
+
Otherwise,
+
((Dr2 const&)rhs).equal((Dr1 const&)lhs).
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

!((Dr1 const&)lhs).equal((Dr2 const&)rhs).

-
-
Otherwise,
-

!((Dr2 const&)rhs).equal((Dr1 const&)lhs).

-
+
then
+
!((Dr1 const&)lhs).equal((Dr2 const&)rhs).
+
Otherwise,
+
!((Dr2 const&)rhs).equal((Dr1 const&)lhs).
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) < 0.

-
-
Otherwise,
-

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) > 0.

-
+
then
+
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) < 0.
+
Otherwise,
+
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) > 0.
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) <= 0.

-
-
Otherwise,
-

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) >= 0.

-
+
then
+
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) <= 0.
+
Otherwise,
+
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) >= 0.
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) > 0.

-
-
Otherwise,
-

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) < 0.

-
+
then
+
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) > 0.
+
Otherwise,
+
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) < 0.
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) >= 0.

-
-
Otherwise,
-

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) <= 0.

-
+
then
+
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) >= 0.
+
Otherwise,
+
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) <= 0.
-
+
 template <class Dr1, class V1, class TC1, class R1, class D1,
           class Dr2, class V2, class TC2, class R2, class D2>
 typename enable_if_interoperable<Dr1,Dr2,difference>::type
@@ -1447,27 +1138,23 @@ operator -(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
 
 
 Return Type:

if is_convertible<Dr2,Dr1>::value

-
+
-
then
-

difference shall be -iterator_traits<Dr1>::difference_type.

-
-
Otherwise
-

difference shall be iterator_traits<Dr2>::difference_type

-
+
then
+
difference shall be +iterator_traits<Dr1>::difference_type.
+
Otherwise
+
difference shall be iterator_traits<Dr2>::difference_type
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-

-((Dr1 const&)lhs).distance_to((Dr2 const&)rhs).

-
-
Otherwise,
-

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs).

-
+
then
+
-((Dr1 const&)lhs).distance_to((Dr2 const&)rhs).
+
Otherwise,
+
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs).
@@ -1475,14 +1162,11 @@ operator -(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
-
-

Iterator adaptor [lib.iterator.adaptor]

- - - +
+

Iterator adaptor [lib.iterator.adaptor]

- +

Each specialization of the iterator_adaptor class template is derived from a specialization of iterator_facade. The core interface functions expected by iterator_facade are implemented in terms of the @@ -1493,14 +1177,11 @@ Whether the derived class models any of the standard iterator concepts depends on the operations supported by the Base type and which core interface functions of iterator_facade are redefined in the Derived class.

-
-

Class template iterator_adaptor

- - - +
+

Class template iterator_adaptor

- +
 template <
     class Derived
@@ -1510,7 +1191,7 @@ template <
   , class Reference           = use_default
   , class Difference = use_default
 >
-class iterator_adaptor
+class iterator_adaptor 
   : public iterator_facade<Derived, V', C', R', D'> // see details
 {
     friend class iterator_core_access;
@@ -1523,12 +1204,12 @@ class iterator_adaptor
     typedef iterator_adaptor iterator_adaptor_;
     Base const& base_reference() const;
     Base& base_reference();
- private: // Core iterator interface for iterator_facade.
+ private: // Core iterator interface for iterator_facade.  
     typename iterator_adaptor::reference dereference() const;
 
     template <
     class OtherDerived, class OtherIterator, class V, class C, class R, class D
-    >
+    >   
     bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const;
 
     void advance(typename iterator_adaptor::difference_type n);
@@ -1537,7 +1218,7 @@ class iterator_adaptor
 
     template <
         class OtherDerived, class OtherIterator, class V, class C, class R, class D
-    >
+    >   
     typename iterator_adaptor::difference_type distance_to(
         iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const;
 
@@ -1546,13 +1227,13 @@ class iterator_adaptor
 };
 
-
-

iterator_adaptor requirements

+
+

iterator_adaptor requirements

static_cast<Derived*>(iterator_adaptor*) shall be well-formed. The Base argument shall be Assignable and Copy Constructible.

-
-

iterator_adaptor base class parameters

+
+

iterator_adaptor base class parameters

The V', C', R', and D' parameters of the iterator_facade used as a base class in the summary of iterator_adaptor above are defined as follows:

@@ -1592,8 +1273,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
-
-

iterator_adaptor public operations

+
+

iterator_adaptor public operations

iterator_adaptor();

@@ -1601,7 +1282,7 @@ expression involving ``Derived`` in those concepts' requirements. --> - @@ -1626,8 +1307,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
Requires:The Base type must be Default Constructible.
Returns:An instance of iterator_adaptor with +
Returns:An instance of iterator_adaptor with m_iterator default constructed.
-
-

iterator_adaptor protected member functions

+
+

iterator_adaptor protected member functions

Base const& base_reference() const;

@@ -1647,8 +1328,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
-
-

iterator_adaptor private member functions

+
+

iterator_adaptor private member functions

typename iterator_adaptor::reference dereference() const;

@@ -1661,7 +1342,7 @@ expression involving ``Derived`` in those concepts' requirements. -->
 template <
 class OtherDerived, class OtherIterator, class V, class C, class R, class D
->
+>   
 bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const;
 
@@ -1702,7 +1383,7 @@ bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const
 template <
     class OtherDerived, class OtherIterator, class V, class C, class R, class D
->
+>   
 typename iterator_adaptor::difference_type distance_to(
     iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const;
 
@@ -1716,13 +1397,13 @@ typename iterator_adaptor::difference_type distance_to(
-
-

Specialized adaptors [lib.iterator.special.adaptors]

+
+

Specialized adaptors [lib.iterator.special.adaptors]

The enable_if_convertible<X,Y>::type expression used in this section is for exposition purposes. The converting constructors for specialized adaptors should be only be in an overload set provided that an object of type X is implicitly convertible to an object of -type Y. +type Y. The signatures involving enable_if_convertible should behave as-if enable_if_convertible were defined to be:

@@ -1743,13 +1424,10 @@ of enable_if_convertible
 

[Note: The enable_if_convertible approach uses SFINAE to take the constructor out of the overload set when the types are not -implicitly convertible. +implicitly convertible. ]

-
-

Indirect iterator

- - - +
+

Indirect iterator

indirect_iterator adapts an iterator by applying an extra dereference inside of operator*(). For example, this iterator adaptor makes it possible to view a container of pointers @@ -1758,8 +1436,8 @@ iterator adaptor makes it possible to view a container of pointers auxiliary traits, pointee and indirect_reference, to provide support for underlying iterators whose value_type is not an iterator.

-
-

Class template pointee

+
+

Class template pointee

@@ -1802,8 +1480,8 @@ else }
-
-

Class template indirect_reference

+
+

Class template indirect_reference

@@ -1837,11 +1515,8 @@ else std::iterator_traits<Dereferenceable>::reference
-
-

Class template indirect_iterator

- - - +
+

Class template indirect_iterator

 template <
     class Iterator
@@ -1898,9 +1573,9 @@ if (Reference is use_default) then
 else
     typedef Reference reference;
 
-if (Value is use_default) then
+if (Value is use_default) then 
     typedef pointee<V>::type* pointer;
-else
+else 
     typedef Value* pointer;
 
 if (Difference is use_default)
@@ -1918,8 +1593,8 @@ else
     ) iterator_category;
 
-
-

indirect_iterator requirements

+
+

indirect_iterator requirements

The expression *v, where v is an object of iterator_traits<Iterator>::value_type, shall be valid expression and convertible to reference. Iterator shall @@ -1932,8 +1607,8 @@ the requirements indicated by ite parameter is not use_default, as implied by the algorithm for deducing the default for the value_type member.]

-
-

indirect_iterator models

+
+

indirect_iterator models

In addition to the concepts indicated by iterator_category and by iterator_traversal<indirect_iterator>::type, a specialization of indirect_iterator models the following @@ -1953,8 +1628,8 @@ expression (where t i indirect_iterator<Y,V2,C2,R2,D2> if and only if X is interoperable with Y.

-
-

indirect_iterator operations

+
+

indirect_iterator operations

In addition to the operations required by the concepts described above, specializations of indirect_iterator provide the following operations.

@@ -1965,7 +1640,7 @@ following operations.

Requires:Iterator must be Default Constructible. -Effects:Constructs an instance of indirect_iterator with +Effects:Constructs an instance of indirect_iterator with a default-constructed m_iterator. @@ -1998,7 +1673,7 @@ indirect_iterator( Requires:Iterator2 is implicitly convertible to Iterator. -Effects:Constructs an instance of indirect_iterator whose +Effects:Constructs an instance of indirect_iterator whose m_iterator subobject is constructed from y.base(). @@ -2045,18 +1720,12 @@ indirect_iterator(
-
-

Reverse iterator

- - - +
+

Reverse iterator

The reverse iterator adaptor iterates through the adapted iterator range in the opposite direction.

-
-

Class template reverse_iterator

- - - +
+

Class template reverse_iterator

 template <class Iterator>
 class reverse_iterator
@@ -2092,14 +1761,14 @@ Lvalue Iterator, then iterator_ca
 bidirectional_iterator_tag. Otherwise, iterator_category is
 convertible to input_iterator_tag.

-
-

reverse_iterator requirements

+
+

reverse_iterator requirements

Iterator must be a model of Bidirectional Traversal Iterator. The type iterator_traits<Iterator>::reference must be the type of *i, where i is an object of type Iterator.

-
-

reverse_iterator models

+
+

reverse_iterator models

A specialization of reverse_iterator models the same iterator traversal and iterator access concepts modeled by its Iterator argument. In addition, it may model old iterator concepts @@ -2110,8 +1779,8 @@ specified in the following table:

-If I models -then reverse_iterator<I> models +If I models +then reverse_iterator<I> models @@ -2137,8 +1806,8 @@ Random Access Traversal Iterator reverse_iterator<Y> if and only if X is interoperable with Y.

-
-

reverse_iterator operations

+
+

reverse_iterator operations

In addition to the operations required by the concepts modeled by reverse_iterator, reverse_iterator provides the following operations.

@@ -2149,7 +1818,7 @@ operations.

Requires:Iterator must be Default Constructible. -Effects:Constructs an instance of reverse_iterator with m_iterator +Effects:Constructs an instance of reverse_iterator with m_iterator default constructed. @@ -2177,7 +1846,7 @@ reverse_iterator( Requires:OtherIterator is implicitly convertible to Iterator. -Effects:Constructs instance of reverse_iterator whose +Effects:Constructs instance of reverse_iterator whose m_iterator subobject is constructed from y.base(). @@ -2228,24 +1897,18 @@ return *--tmp;
-
-

Transform iterator

- - - +
+

Transform iterator

The transform iterator adapts an iterator by modifying the operator* to apply a function object to the result of dereferencing the iterator and returning the result.

-
-

Class template transform_iterator

- - - +
+

Class template transform_iterator

 template <class UnaryFunction,
-          class Iterator,
-          class Reference = use_default,
+          class Iterator, 
+          class Reference = use_default, 
           class Value = use_default>
 class transform_iterator
 {
@@ -2292,8 +1955,8 @@ convertible to forward_iterator_t
 model Readable Lvalue Iterator then iterator_category is
 convertible to input_iterator_tag.

-
-

transform_iterator requirements

+
+

transform_iterator requirements

The type UnaryFunction must be Assignable, Copy Constructible, and the expression f(*i) must be valid where f is an object of type UnaryFunction, i is an object of type Iterator, and @@ -2301,8 +1964,8 @@ where the type of f(*i)result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.

The argument Iterator shall model Readable Iterator.

-
-

transform_iterator models

+
+

transform_iterator models

The resulting transform_iterator models the most refined of the following that is also modeled by Iterator.

@@ -2323,8 +1986,8 @@ the Iterator argument -If Iterator models -then transform_iterator models +If Iterator models +then transform_iterator models @@ -2348,8 +2011,8 @@ mutable iterator (as defined in the old iterator requirements).

transform_iterator<F2, Y, R2, V2> if and only if X is interoperable with Y.

-
-

transform_iterator operations

+
+

transform_iterator operations

In addition to the operations required by the concepts modeled by transform_iterator, transform_iterator provides the following operations.

@@ -2444,11 +2107,8 @@ initialized to t.functor()
-
-

Filter iterator

- - - +
+

Filter iterator

The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. A predicate function object controls which elements are skipped. When the predicate is @@ -2459,12 +2119,12 @@ adaptor to know when to stop so as to avoid going past the end of the underlying range. A filter iterator is therefore constructed with pair of iterators indicating the range of elements in the unfiltered sequence to be traversed.

-
-

Class template filter_iterator

+
+

Class template filter_iterator

- +
 template <class Predicate, class Iterator>
 class filter_iterator
@@ -2497,15 +2157,15 @@ private:
 

If Iterator models Readable Lvalue Iterator and Bidirectional Traversal Iterator then iterator_category is convertible to -std::bidirectional_iterator_tag. +std::bidirectional_iterator_tag. Otherwise, if Iterator models Readable Lvalue Iterator and Forward Traversal Iterator then iterator_category is convertible to -std::forward_iterator_tag. +std::forward_iterator_tag. Otherwise iterator_category is convertible to std::input_iterator_tag.

-
-

filter_iterator requirements

+
+

filter_iterator requirements

The Iterator argument shall meet the requirements of Readable Iterator and Single Pass Iterator or it shall meet the requirements of Input Iterator.

@@ -2515,8 +2175,8 @@ the expression p(x) m iterator_traits<Iterator>::value_type, and where the type of p(x) must be convertible to bool.

-
-

filter_iterator models

+
+

filter_iterator models

The concepts that filter_iterator models are dependent on which concepts the Iterator argument models, as specified in the following tables.

@@ -2526,8 +2186,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2548,8 +2208,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2570,8 +2230,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2589,11 +2249,11 @@ following tables.

-

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> +

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> if and only if X is interoperable with Y.

-
-

filter_iterator operations

+
+

filter_iterator operations

In addition to those operations required by the concepts that filter_iterator models, filter_iterator provides the following operations.

@@ -2604,7 +2264,7 @@ operations.

Requires:Predicate and Iterator must be Default Constructible. -Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end +Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end members are a default constructed. @@ -2615,7 +2275,7 @@ members are a default constructed. Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that f(*m_iter) == true +the first position in the range [x,end) such that f(*m_iter) == true or else``m_iter == end``. The member m_pred is constructed from f and m_end from end. @@ -2630,7 +2290,7 @@ or else``m_iter == end``. The member Predicate is a class type (not a function pointer). Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that m_pred(*m_iter) == true +the first position in the range [x,end) such that m_pred(*m_iter) == true or else``m_iter == end``. The member m_pred is default constructed. @@ -2703,19 +2363,13 @@ or m_pred(*m_iter)
-
-

Counting iterator

- - - +
+

Counting iterator

counting_iterator adapts an object by adding an operator* that returns the current value of the object. All other iterator operations are forwarded to the adapted object.

-
-

Class template counting_iterator

- - - +
+

Class template counting_iterator

 template <
     class Incrementable
@@ -2755,7 +2409,7 @@ else if (numeric_limits<Incrementable>::is_specialized)
         random_access_traversal_tag, Incrementable, const Incrementable&)
 else
     return iterator-category(
-         iterator_traversal<Incrementable>::type,
+         iterator_traversal<Incrementable>::type, 
          Incrementable, const Incrementable&)
 
@@ -2765,8 +2419,8 @@ the cases where std::numeric_limi is true.]
-
-

counting_iterator requirements

+
+

counting_iterator requirements

The Incrementable argument shall be Copy Constructible and Assignable.

If iterator_category is convertible to forward_iterator_tag or forward_traversal_tag, the following must be well-formed:

@@ -2791,8 +2445,8 @@ n = i - j; i < j;
-
-

counting_iterator models

+
+

counting_iterator models

Specializations of counting_iterator model Readable Lvalue Iterator. In addition, they model the concepts corresponding to the iterator tags to which their iterator_category is convertible. @@ -2807,8 +2461,8 @@ concepts modeled by Incrementable counting_iterator<Y,C2,D2> if and only if X is interoperable with Y.

-
-

counting_iterator operations

+
+

counting_iterator operations

In addition to the operations required by the concepts modeled by counting_iterator, counting_iterator provides the following operations.

@@ -2883,11 +2537,8 @@ operations.

-
-

Function output iterator

- - - +
+

Function output iterator

The function output iterator adaptor makes it easier to create custom output iterators. The adaptor takes a unary function and creates a model of Output Iterator. Each item assigned to the output iterator is @@ -2895,14 +2546,11 @@ passed as an argument to the unary function. The motivation for this iterator is that creating a conforming output iterator is non-trivial, particularly because the proper implementation usually requires a proxy object.

-
-

Class template function_output_iterator

- - - + -
-

Header

+ -
-

function_output_iterator requirements

+
+

function_output_iterator requirements

UnaryFunction must be Assignable and Copy Constructible.

-
-

function_output_iterator models

+
+

function_output_iterator models

function_output_iterator is a model of the Writable and Incrementable Iterator concepts.

-
-

function_output_iterator operations

+
+

function_output_iterator operations

explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());

- @@ -2988,5 +2636,10 @@ LocalWords: OtherIncrementable Coplien --> + + diff --git a/doc/facade-and-adaptor.rst b/doc/facade-and-adaptor.rst index 1be63e8..fbaf0f3 100644 --- a/doc/facade-and-adaptor.rst +++ b/doc/facade-and-adaptor.rst @@ -1,7 +1,3 @@ -.. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - +++++++++++++++++++++++++++++ Iterator Facade and Adaptor +++++++++++++++++++++++++++++ diff --git a/doc/filter_iterator.html b/doc/filter_iterator.html index 9b3eaa9..bba015f 100644 --- a/doc/filter_iterator.html +++ b/doc/filter_iterator.html @@ -3,298 +3,15 @@ - +Filter Iterator - + -

Filter Iterator

Effects:Constructs an instance of function_output_iterator +
Effects:Constructs an instance of function_output_iterator with m_f constructed from f.
@@ -314,21 +31,16 @@ Railway Operation and Construction
Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003.
- - - - +
+
-
abstract: - - -The filter iterator adaptor creates a view of an iterator range in +
abstract:The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. A predicate function object controls which elements are skipped. When the predicate is -applied to an element, if it returns true then the element is -retained and if it returns false then the element is skipped +applied to an element, if it returns true then the element is +retained and if it returns false then the element is skipped over. When skipping over elements, it is necessary for the filter adaptor to know when to stop so as to avoid going past the end of the underlying range. A filter iterator is therefore constructed with pair @@ -337,22 +49,22 @@ sequence to be traversed.
-
-

Table of Contents

+ -
-

filter_iterator synopsis

+
+

filter_iterator synopsis

- +
 template <class Predicate, class Iterator>
 class filter_iterator
@@ -383,39 +95,39 @@ private:
     Iterator m_end;   // exposition only
 };
 
-

If Iterator models Readable Lvalue Iterator and Bidirectional Traversal -Iterator then iterator_category is convertible to -std::bidirectional_iterator_tag. -Otherwise, if Iterator models Readable Lvalue Iterator and Forward Traversal -Iterator then iterator_category is convertible to -std::forward_iterator_tag. -Otherwise iterator_category is -convertible to std::input_iterator_tag.

+

If Iterator models Readable Lvalue Iterator and Bidirectional Traversal +Iterator then iterator_category is convertible to +std::bidirectional_iterator_tag. +Otherwise, if Iterator models Readable Lvalue Iterator and Forward Traversal +Iterator then iterator_category is convertible to +std::forward_iterator_tag. +Otherwise iterator_category is +convertible to std::input_iterator_tag.

-
-

filter_iterator requirements

-

The Iterator argument shall meet the requirements of Readable +

+

filter_iterator requirements

+

The Iterator argument shall meet the requirements of Readable Iterator and Single Pass Iterator or it shall meet the requirements of Input Iterator.

-

The Predicate argument must be Assignable, Copy Constructible, and -the expression p(x) must be valid where p is an object of type -Predicate, x is an object of type -iterator_traits<Iterator>::value_type, and where the type of -p(x) must be convertible to bool.

+

The Predicate argument must be Assignable, Copy Constructible, and +the expression p(x) must be valid where p is an object of type +Predicate, x is an object of type +iterator_traits<Iterator>::value_type, and where the type of +p(x) must be convertible to bool.

-
-

filter_iterator models

-

The concepts that filter_iterator models are dependent on which -concepts the Iterator argument models, as specified in the +

+

filter_iterator models

+

The concepts that filter_iterator models are dependent on which +concepts the Iterator argument models, as specified in the following tables.

- +
- - + + @@ -430,14 +142,14 @@ following tables.

If Iterator modelsthen filter_iterator models
If Iterator modelsthen filter_iterator models
- +
- - + + @@ -452,14 +164,14 @@ following tables.

If Iterator modelsthen filter_iterator models
If Iterator modelsthen filter_iterator models
- +
- - + + @@ -477,49 +189,49 @@ following tables.

If Iterator modelsthen filter_iterator models
If Iterator modelsthen filter_iterator models
-

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> -if and only if X is interoperable with Y.

+

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> +if and only if X is interoperable with Y.

-
-

filter_iterator operations

+
+

filter_iterator operations

In addition to those operations required by the concepts that -filter_iterator models, filter_iterator provides the following +filter_iterator models, filter_iterator provides the following operations.

-

filter_iterator();

- +

filter_iterator();

+
- + -
Requires:Predicate and Iterator must be Default Constructible.
Requires:Predicate and Iterator must be Default Constructible.
Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end +
Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end members are a default constructed.
-

filter_iterator(Predicate f, Iterator x, Iterator end = Iterator());

- +

filter_iterator(Predicate f, Iterator x, Iterator end = Iterator());

+
- +
Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that f(*m_iter) == true -or else``m_iter == end``. The member m_pred is constructed from -f and m_end from end.
Effects:Constructs a filter_iterator where m_iter is either +the first position in the range [x,end) such that f(*m_iter) == true +or else``m_iter == end``. The member m_pred is constructed from +f and m_end from end.
-

filter_iterator(Iterator x, Iterator end = Iterator());

- +

filter_iterator(Iterator x, Iterator end = Iterator());

+
- + - +
Requires:Predicate must be Default Constructible and -Predicate is a class type (not a function pointer).
Requires:Predicate must be Default Constructible and +Predicate is a class type (not a function pointer).
Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that m_pred(*m_iter) == true -or else``m_iter == end``. The member m_pred is default constructed.
Effects:Constructs a filter_iterator where m_iter is either +the first position in the range [x,end) such that m_pred(*m_iter) == true +or else``m_iter == end``. The member m_pred is default constructed.
@@ -530,74 +242,71 @@ filter_iterator( , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 // exposition );`` - +
- + - +
Requires:OtherIterator is implicitly convertible to Iterator.
Requires:OtherIterator is implicitly convertible to Iterator.
Effects:Constructs a filter iterator whose members are copied from t.
Effects:Constructs a filter iterator whose members are copied from t.
-

Predicate predicate() const;

- +

Predicate predicate() const;

+
- +
Returns:m_pred
Returns:m_pred
-

Iterator end() const;

- +

Iterator end() const;

+
- +
Returns:m_end
Returns:m_end
-

Iterator const& base() const;

- +

Iterator const& base() const;

+
- +
Returns:m_iterator
Returns:m_iterator
-

reference operator*() const;

- +

reference operator*() const;

+
- +
Returns:*m_iter
Returns:*m_iter
-

filter_iterator& operator++();

- +

filter_iterator& operator++();

+
- + - +
Effects:Increments m_iter and then continues to -increment m_iter until either m_iter == m_end -or m_pred(*m_iter) == true.
Effects:Increments m_iter and then continues to +increment m_iter until either m_iter == m_end +or m_pred(*m_iter) == true.
Returns:*this
Returns:*this
- - -
 template <class Predicate, class Iterator>
 filter_iterator<Predicate,Iterator>
 make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator());
 
- +
@@ -610,7 +319,7 @@ template <class Predicate, class Iterator> filter_iterator<Predicate,Iterator> make_filter_iterator(Iterator x, Iterator end = Iterator()); -
+
@@ -618,16 +327,13 @@ make_filter_iterator(Iterator x, Iterator end = Iterator());
- - -
-
-

Example

-

This example uses filter_iterator and then -make_filter_iterator to output only the positive integers from an -array of integers. Then make_filter_iterator is is used to output -the integers greater than -2.

+
+

Example

+

This example uses filter_iterator and then +make_filter_iterator to output only the positive integers from an +array of integers. Then make_filter_iterator is is used to output +the integers greater than -2.

 struct is_positive_number {
   bool operator()(int x) { return 0 < x; }
@@ -678,12 +384,17 @@ int main()
 

The output is:

-4 5 8
-4 5 8
-0 -1 4 5 8
+4 5 8 
+4 5 8 
+0 -1 4 5 8 
 

The source code for this example can be found here.

+ + diff --git a/doc/filter_iterator.rst b/doc/filter_iterator.rst index cfa8642..2b1ebc3 100644 --- a/doc/filter_iterator.rst +++ b/doc/filter_iterator.rst @@ -1,7 +1,3 @@ -.. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - +++++++++++++++++ Filter Iterator +++++++++++++++++ diff --git a/doc/filter_iterator_abstract.rst b/doc/filter_iterator_abstract.rst index 9524efa..4695478 100644 --- a/doc/filter_iterator_abstract.rst +++ b/doc/filter_iterator_abstract.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. A predicate function object controls which elements are skipped. When the predicate is diff --git a/doc/filter_iterator_eg.rst b/doc/filter_iterator_eg.rst index dc2770e..36448fe 100644 --- a/doc/filter_iterator_eg.rst +++ b/doc/filter_iterator_eg.rst @@ -1,6 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Example ....... diff --git a/doc/func_output_iter_abstract.rst b/doc/func_output_iter_abstract.rst index d4a700f..11fb4f1 100644 --- a/doc/func_output_iter_abstract.rst +++ b/doc/func_output_iter_abstract.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - The function output iterator adaptor makes it easier to create custom output iterators. The adaptor takes a unary function and creates a model of Output Iterator. Each item assigned to the output iterator is diff --git a/doc/func_output_iter_ref.rst b/doc/func_output_iter_ref.rst index e00eab7..97e2e17 100644 --- a/doc/func_output_iter_ref.rst +++ b/doc/func_output_iter_ref.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Header ...... diff --git a/doc/function_output_iterator.html b/doc/function_output_iterator.html index bea15ba..94a5840 100644 --- a/doc/function_output_iterator.html +++ b/doc/function_output_iterator.html @@ -3,295 +3,13 @@ - + Function Output Iterator - +
@@ -314,17 +32,11 @@ Railway Operation and Construction Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. - - - -
abstract: - - -The function output iterator adaptor makes it easier to create custom +
abstract:The function output iterator adaptor makes it easier to create custom output iterators. The adaptor takes a unary function and creates a model of Output Iterator. Each item assigned to the output iterator is passed as an argument to the unary function. The motivation for this @@ -334,8 +46,8 @@ proxy object.
-
-

Table of Contents

+ - - - -
-

Header

+ -
-

function_output_iterator requirements

+
+

function_output_iterator requirements

UnaryFunction must be Assignable and Copy Constructible.

-
-

function_output_iterator models

+
+

function_output_iterator models

function_output_iterator is a model of the Writable and Incrementable Iterator concepts.

-
-

function_output_iterator operations

+
+

function_output_iterator operations

explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());

- @@ -423,12 +132,9 @@ is equivalent to m_f(t)
Effects:Constructs an instance of function_output_iterator +
Effects:Constructs an instance of function_output_iterator with m_f constructed from f.
- - -
-
-

Example

+
+

Example

 struct string_appender
 {
@@ -453,7 +159,7 @@ int main(int, char*[])
   x.push_back("!");
 
   std::string s = "";
-  std::copy(x.begin(), x.end(),
+  std::copy(x.begin(), x.end(), 
             boost::make_function_output_iterator(string_appender(s)));
 
   std::cout << s << std::endl;
@@ -463,5 +169,10 @@ int main(int, char*[])
 
+ + diff --git a/doc/function_output_iterator.rst b/doc/function_output_iterator.rst index 8018af5..a78c950 100644 --- a/doc/function_output_iterator.rst +++ b/doc/function_output_iterator.rst @@ -1,7 +1,3 @@ -.. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - ++++++++++++++++++++++++++ Function Output Iterator ++++++++++++++++++++++++++ diff --git a/doc/function_output_iterator_eg.rst b/doc/function_output_iterator_eg.rst index ab09f2d..eb635df 100644 --- a/doc/function_output_iterator_eg.rst +++ b/doc/function_output_iterator_eg.rst @@ -1,7 +1,3 @@ -.. Copyright David Abrahams 2006. Distributed under the Boost -.. Software License, Version 1.0. (See accompanying -.. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - Example ....... diff --git a/doc/index.html b/doc/index.html index eef53b1..0868477 100755 --- a/doc/index.html +++ b/doc/index.html @@ -3,298 +3,13 @@ - + The Boost.Iterator Library Boost - +