Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-04-05 12:04:49


----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, April 05, 2001 12:10 PM
Subject: Re: [boost] complex_adaptor, iterator_adaptor, etc.

> On 5 Apr 2001 nbecker_at_[hidden] wrote:
> nbecke>
> nbecke> One problem I've encountered is what to do with:
> nbecke>
> nbecke> Reference dereference(type<Reference>, const BaseIterator& i)
const
> nbecke>
> nbecke> For example, if you are adapting a complex container extracting
the
> nbecke> real part, you can't get a reference to it. I guess the only
choice
> nbecke> would be to return a proxy object that overloads assignment?
>
> Well, if you could get at a reference to the real part, then you could use
> the projection iterator adaptor. But, as you point out below, you can't.
> So you're stuck with the ugly proxy thing (you'd be stuck with this
> whether or not you used iterator adaptor). You'll need to use the proxy
> object as the Reference type of the iterator adaptor. And you'll be stuck
> with using input_iterator_tag as the iterator_category :(
>
> (yet another example of the need for my new iterator categories and
> concepts)

Why bother with the proxy if you're just doing input iterators? Do you need
to write through the Reference type?

-Dave


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