Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-06 23:49:15


----- Original Message -----
From: "rogeeff" <rogeeff_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, January 06, 2002 11:25 PM
Subject: [boost] Re: Proposed Iterator Adaptor change

> --- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> > Hi Jeremy and/or anyone else who cares,
> >
> > I am thinking that the iterator adaptor library is overly
> enthusiastic in
> > selecting the operator_arror_proxy for the result of its operator->
> ()
> > whenever the iterator is no more refined than InputIterator.
> Shouldn't we
> > also ask whether the associated reference type is not a reference
> before we
> > resort to the proxy? That would be more efficient for lots of
> cases, and
> > would even enable operator->() when iterator_adaptor is used to
> iterate over
> > an abstract class.
> >
> > Have I missed something?
> >
> > -Dave
>
> Maybe 'instead' in place of 'also'?

Hmm; you're probably right. There's no point in checking the iterator
category since ForwardIterators' reference type must be a true reference
anyway.

> I have several input iterators
> based on iterator adaptor, that have an operator ->() returning
> reference to some internal buffer.

I suppose you mean operator*()? Right now, if your iterator_category is
input_iterator_tag, you get the proxy.

> I would not want a proxy in that case.

Agreed.

I'll make the change tomorrow unless I hear some valid objections.

-Dave


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