From 961c08a82f1143883cb95a78dde5490696a8a4d4 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 18 Feb 2001 21:50:57 +0000 Subject: [PATCH] Apply Jens' suggested fixes [SVN r9263] --- iterator_adaptors.htm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/iterator_adaptors.htm b/iterator_adaptors.htm index 5004aee..0bc8ffb 100644 --- a/iterator_adaptors.htm +++ b/iterator_adaptors.htm @@ -542,22 +542,29 @@ int main(int, char*[])

Example

-

The Projection Iterator portion of this - library lets you create iterators which, when dereferenced, apply a function to the result of - dereferencing their base iterator. The The Projection Iterator adaptor is similar to the transform iterator adaptor in that +its operator*() applies some function to the result of +dereferencing the base iterator and then returns the result. The +difference is that the function must return a reference to some +existing object (for example, a data member within the +value_type of the base iterator). + +

+The projection_iterator_pair_generator template is a special two-type generator for mutable and constant versions of a projection iterator. It is defined as follows:

-template <class Function, class Iterator, class ConstIterator>
+template <class AdaptableUnaryFunction, class Iterator, class ConstIterator>
 struct projection_iterator_pair_generator {
     typedef typename AdaptableUnaryFunction::result_type value_type;
-    typedef projection_iterator_policies<Function> policies;
+    typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
 public:
     typedef iterator_adaptor<Iterator,policies,value_type> iterator;
     typedef iterator_adaptor<ConstIterator,policies,value_type,
-        const value_type&,const value_type*> type;
+        const value_type&,const value_type*> const_iterator;
 };