Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2004-07-23 03:29:58


David Abrahams <dave_at_[hidden]> writes:

>> For Forward, Bidi and Random-access Iterators, it returns a reference to a
>> value held in the iterator.
>
> I'm afraid those aren't conforming forward iterators :(
>
> 24.1.3:
>
> "If a and b are both dereferenceable, then a == b if and only if
> *a and *b are the same object. "
>
> Which is why we have to change counting_iterator to not be a forward
> iterator.

Darn. I missed that requirement --- I was working off table 74, which just
requires *a==*b if a==b (amusingly adding a requirement that the value type
supports operator== in the process). This requirement makes it actually
impossible to make an aggregating iterator anything other than an input or
output iterator.

:(

On the plus side, my tuple iterator works with std::sort on every compiler
I've tested it on. Do you know of any implementations that depend on this
requirement being met for any of the standard algorithms?

Maybe your effort on the new iterator categories can help with the problem?

Anthony

-- 
Anthony Williams
Senior Software Engineer, Beran Instruments Ltd.

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