forked from boostorg/utility
Apply Jens' suggested fixes
[SVN r9263]
This commit is contained in:
@@ -542,22 +542,29 @@ int main(int, char*[])
|
|||||||
|
|
||||||
<h4>Example</h4>
|
<h4>Example</h4>
|
||||||
|
|
||||||
<p>The <a href="projection_iterator.htm">Projection Iterator</a> portion of this
|
<p>The <a href="projection_iterator.htm">Projection Iterator</a> adaptor is similar to the <a
|
||||||
library lets you create iterators which, when dereferenced, apply a function to the result of
|
href="./transform_iterator.htm">transform iterator adaptor</a> in that
|
||||||
dereferencing their base iterator. The <a
|
its <tt>operator*()</tt> 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
|
||||||
|
<tt>value_type</tt> of the base iterator).
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <a
|
||||||
href="projection_iterator.htm#projection_iterator_pair_generator">projection_iterator_pair_generator</a> template
|
href="projection_iterator.htm#projection_iterator_pair_generator">projection_iterator_pair_generator</a> template
|
||||||
is a special two-<a href="../../more/generic_programming.html#type_generator">type generator</a> for mutable and constant versions of a
|
is a special two-<a href="../../more/generic_programming.html#type_generator">type generator</a> for mutable and constant versions of a
|
||||||
projection iterator. It is defined as follows:
|
projection iterator. It is defined as follows:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>
|
<pre>
|
||||||
template <class Function, class Iterator, class ConstIterator>
|
template <class AdaptableUnaryFunction, class Iterator, class ConstIterator>
|
||||||
struct projection_iterator_pair_generator {
|
struct projection_iterator_pair_generator {
|
||||||
typedef typename AdaptableUnaryFunction::result_type value_type;
|
typedef typename AdaptableUnaryFunction::result_type value_type;
|
||||||
typedef projection_iterator_policies<Function> policies;
|
typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
|
||||||
public:
|
public:
|
||||||
typedef iterator_adaptor<Iterator,policies,value_type> iterator;
|
typedef iterator_adaptor<Iterator,policies,value_type> iterator;
|
||||||
typedef iterator_adaptor<ConstIterator,policies,value_type,
|
typedef iterator_adaptor<ConstIterator,policies,value_type,
|
||||||
const value_type&,const value_type*> type;
|
const value_type&,const value_type*> const_iterator;
|
||||||
};
|
};
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
Reference in New Issue
Block a user