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.

-Dave

----- 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
the
> contents of that one field. A reference not a copy is required in this
case.
> (Oh all right, I could return a copy of a pointer to the data, but it
seems
> dumb.)
>
> If you don't want to support this, I understand but it may mean we
diverage
> 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 http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk