Boost logo

Boost :

From: John E. Potter (jpotter_at_[hidden])
Date: 2000-12-20 17:59:09


On Mon, 18 Dec 2000 scleary_at_[hidden] wrote:

> Notes (all of these apply to the Transform Iterator adaptor, too):
> [1] I'm not sure that we should typedef a non-reference type to be
> "reference". The only input iterator supplied by the STL has that typedef
> as a (const) reference type.

I see typedef T const& reference. The required typedef is reference.
I understand your concern though.

> [2] I think the "pointer" type should be "const value_type *".

It really makes no difference. Pointer is the type returned by
operator->. That operator returns &operator*(). But, operator*
returns an rvalue and address of may not be used on an rvalue.

> [3] This adaptor does not return a reference type when dereferenced; thus,
> it should only claim to be an input iterator (it can still support [], +=,
> etc., though) (flame-resistent hat on now...)

It can't even claim that. If you check the input iterator requirements
closely, I think you will find that it can only be an input iterator
when the value type is a built-in, and I am not even sure of that.

If it were buffered like istream_iterator, then it would be fine.

Now that the can of worms is open, is it important? It has been
noted that anything can be an iterator; however, not anything can
be a standard conforming iterator.

Go with the utility or buffer it?

John


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