From a5c3dcdd02cf00588a0c1bbd4b541872f1e70bb4 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sun, 11 Feb 2001 02:55:38 +0000 Subject: [PATCH] redid docs for the template parameters [SVN r9102] --- filter_iterator.htm | 64 ++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/filter_iterator.htm b/filter_iterator.htm index 6cdcfac..3010f9d 100644 --- a/filter_iterator.htm +++ b/filter_iterator.htm @@ -32,12 +32,12 @@ element is skipped over.
 namespace boost {
-  template <class Predicate, class Iterator, ...>
+  template <class Predicate, class BaseIterator, ...>
   class filter_iterator_generator;
 
-  template <class Predicate, class Iterator>
-  typename filter_iterator_generator<Predicate, Iterator>::type
-  make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate());
+  template <class Predicate, class BaseIterator>
+  typename filter_iterator_generator<Predicate, BaseIterator>::type
+  make_filter_iterator(BaseIterator first, BaseIterator last, const Predicate& p = Predicate());
 }
 
@@ -48,25 +48,20 @@ Generator The class filter_iterator_generator is a helper class who's purpose is to construct a filter iterator adaptor type. The template parameters for this class are the Predicate function object -type and the Iterator type that is being wrapped. In most +type and the BaseIterator type that is being wrapped. In most cases the associated types for the wrapped iterator can be deduced from std::iterator_traits, but in some situations the user may want to override these types, so there are also template parameters for each of the iterator's associated types.
-template <class Predicate, 
-          class Iterator,
-          class Value = std::iterator_traits<Iterator>::value_type,
-          class Pointer = std::iterator_traits<Iterator>::pointer,
-          class Reference = std::iterator_traits<Iterator>::reference,
-          class Category = std::iterator_traits<Iterator>::iterator_category,
-          class Distance = std::iterator_traits<Iterator>::difference_type,
+template <class Predicate, class BaseIterator,
+          class Value, class Pointer, class Reference, class Category, class Distance>
 class filter_iterator_generator
 {
 public:
-  typedef ... type;          // the filter iterator_adaptor type
-  typedef ... policies_type; // the filter policies type
+  typedef ... type;          // the resulting filter iterator_adaptor type
+  typedef ... policies_type; // the policies type for the iterator adaptor
 }
 
@@ -113,48 +108,57 @@ The output is: -Iterator +BaseIterator The iterator type being wrapped. This type must at least be a model of the InputIterator concept. Value -The value_type for the iterator adaptor. Typically the default for -this parameter is the appropriate type[1].
-Default: std::iterator_traits<Iterator>::value_type +The value_type of the resulting iterator, +unless const. If const, a conforming compiler strips constness for the +value_type. Typically the default for this parameter is the +appropriate type[1].
Default: +std::iterator_traits<BaseIterator>::value_type Pointer -The pointer type for the iterator adaptor. Typically the default for +The pointer type of the resulting iterator, and in + particular, the result type of operator->(). + Typically the default for this parameter is the appropriate type.
-Default: std::iterator_traits<Iterator>::pointer +Default: If Value was supplied, then Value*, +otherwise std::iterator_traits<BaseIterator>::pointer. Reference -The reference type for the iterator adaptor. Typically the default for -this parameter is the appropriate type.
-Default: std::iterator_traits<Iterator>::reference + +The reference type of the resulting iterator, and in +particular, the result type of operator*(). Typically the default for +this parameter is the appropriate type.
Default: If +Value is supplied, Value& is used. Otherwise +std::iterator_traits<BaseIterator>::reference is +used. Category -The iterator_category type for the iterator adaptor. +The iterator_category type for the resulting iterator. Typically the default for this parameter is the appropriate type. If you override this parameter, do not use bidirectional_iterator_tag because filter iterators can not go in reverse.
-Default: std::iterator_traits<Iterator>::iterator_category +Default: std::iterator_traits<BaseIterator>::iterator_category Distance -The difference_type for the iterator adaptor. Typically the default for +The difference_type for the resulting iterator. Typically the default for this parameter is the appropriate type.
-Default: std::iterator_traits<Iterator>::difference_type +Default: std::iterator_traits<BaseIterator>::difference_type @@ -176,9 +180,9 @@ depending on the adapted iterator type.

The Make Filter Iterator Function

-template <class Predicate, class Iterator>
-typename detail::filter_generator<Predicate, Iterator>::type
-make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate())
+template <class Predicate, class BaseIterator>
+typename detail::filter_generator<Predicate, BaseIterator>::type
+make_filter_iterator(BaseIterator first, BaseIterator last, const Predicate& p = Predicate())
 
This function provides a convenient way to create filter iterators.