Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-27 18:28:24

Let me try to explain a little more carefully.

If you are returning values from your function, your iterator cannot be more
refined than InputIterator (unless you store a cached copy of the value in
the iterator) because all other iterator categories require a true reference
be returned when dereferenced

That's why we have both Transform Iterator and Projection Iterator.
projection_iterator_generator applies to functions that return references,
so the result may model a concept as refined as RandomAccessIterator. The
resulting iterator has the same iterator_category as the Iterator it wraps.


----- Original Message -----
From: "Gary Powell" <Gary.Powell_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, March 27, 2001 12:34 PM
Subject: RE: [boost] iterator_adaptors.hpp/transform_iterator

> As I see it, for VTL, I don't want just value semantics for
> transform_iterators. Depending on the function I may want a reference
> returned. (The issue isn't just increment and decrement.)
> As an example I have used a transform_view to make a container of player
> data return only a field in the data, then using the iterator, modified
> contents of that one field. A reference not a copy is required in this
> (Oh all right, I could return a copy of a pointer to the data, but it
> dumb.)
> If you don't want to support this, I understand but it may mean we
> the code for a while, and that seems a shame.
> I'll go check out your proposal...
> -gary-
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
> Your use of Yahoo! Groups is subject to

Boost list run by bdawes at, gregod at, cpdaniel at, john at