some changes from Dave

[SVN r21658]
This commit is contained in:
Jeremy Siek
2004-01-13 02:53:04 +00:00
parent 250a374e07
commit 1e3b131a84
10 changed files with 30 additions and 44 deletions

View File

@ -1,10 +1,11 @@
The filter iterator adaptor creates a view of an iterator range in The filter iterator adaptor creates a view of an iterator range in
which some elements of the range are skipped over. A predicate which some elements of the range are skipped. A predicate function
function object controls which elements are skipped. When the object controls which elements are skipped. When the predicate is
predicate is applied to an element, if it returns ``true`` then the applied to an element, if it returns ``true`` then the element is
element is retained and if it returns ``false`` then the element is retained and if it returns ``false`` then the element is skipped
skipped over. When skipping over elements, it is necessary for the over. When skipping over elements, it is necessary for the filter
filter adaptor to know when to stop so as to avoid going past the end adaptor to know when to stop so as to avoid going past the end of the
of the underlying range. Therefore the constructor of the filter underlying range. A filter iterator is therefore constructed with pair
iterator takes two iterator parameters: the position for the filtered of iterators indicating the range of elements in the unfiltered
iterator and the end of the range. sequence to be traversed.

View File

@ -54,7 +54,7 @@ Input Iterator.
``filter_iterator`` models ``filter_iterator`` models
.......................... ..........................
The concepts that ``filter_iterator`` models are dependent on what The concepts that ``filter_iterator`` models are dependent on which
concepts the ``Iterator`` argument models, as specified in the concepts the ``Iterator`` argument models, as specified in the
following tables. following tables.

View File

@ -5,17 +5,19 @@
filter_iterator<Predicate,Iterator> filter_iterator<Predicate,Iterator>
make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator()); make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator());
:Returns: An instance of ``filter_iterator<Predicate,Iterator>`` at :Returns: An instance of ``filter_iterator<Predicate,Iterator>``
the first position in the range ``[x,end)`` such that where ``m_iter`` is either the first position in the range ``[x,end)`` such that
``f(*this->base()) == true`` or else at position ``end``. ``f(*this->base()) == true`` or else ``m_iter == end``.
The member ``m_pred`` is constructed from ``f`` and ``m_end`` from ``end``.
:: ::
template <class Predicate, class Iterator> template <class Predicate, class Iterator>
filter_iterator<Predicate,Iterator> filter_iterator<Predicate,Iterator>
make_filter_iterator(Iterator x, Iterator end = Iterator()); make_filter_iterator(Iterator x, Iterator end = Iterator());
:Returns: An instance of ``filter_iterator<Predicate,Iterator>`` at :Returns: An instance of ``filter_iterator<Predicate,Iterator>``
the first position in the range ``[x,end)`` where ``m_iter`` is either the first position in the range ``[x,end)``
such that ``f(*this->base()) == true``, where ``f`` is a default such that ``f(*this->base()) == true``, where ``f`` is a default
constructed ``Predicate``, or else at position ``end``. constructed ``Predicate``, or else ``m_iter == end``.
The member ``m_pred`` is default constructed and ``m_end``
is constructed from ``end``.

View File

@ -42,27 +42,10 @@ Iterator and Readable Iterator.
``reverse_iterator`` models ``reverse_iterator`` models
........................... ...........................
The concepts that ``reverse_iterator`` models are dependent on what ``reverse_iterator`` models the same standard traversal and access
concepts the ``Iterator`` argument models, as specified in the iterator concepts that the ``Iterator`` argument models. In addition,
following tables. ``reverse_iterator`` models the old iterator concepts specified in the
following table, depnding on what the ``Iterator`` argument models.
+----------------------------------+-------------------------------------+
| If ``Iterator`` models | then ``reverse_iterator`` models |
+==================================+=====================================+
| Bidirectional Traversal Iterator | Bidirectional Traversal Iterator |
+----------------------------------+-------------------------------------+
| Random Access Traversal Iterator | Random Access Traversal Iterator |
+----------------------------------+-------------------------------------+
+--------------------------------+----------------------------------------------+
| If ``Iterator`` models | then ``reverse_iterator`` models |
+================================+==============================================+
| Readable Iterator | Readable Iterator |
+--------------------------------+----------------------------------------------+
| Writable Iterator | Writable Iterator |
+--------------------------------+----------------------------------------------+
| Lvalue Iterator | Lvalue Iterator |
+--------------------------------+----------------------------------------------+
+-------------------------------------------------------+----------------------------------+ +-------------------------------------------------------+----------------------------------+