Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-23 20:01:14

Bjorn.Karlsson_at_[hidden] writes:

>> From: David Abrahams [mailto:dave_at_[hidden]]
>> Hey! These implementations using "advance" don't work for
>> non-iterators (e.g. int) the way regular next() and prior() do. I
>> consider this a bug!
> Are there really use cases where implementations should work seamlessly for
> both non-iterators and iterators? Or are there (common) non-iterator types
> that share the iterators' "operator++() but not operator+()" issue? I
> understand the problem that next/prior solves for iterators, but when
> dealing with numeric types, I'm thinking there's always binary +/- operators
> available.

See counting_iterator for inspiration as to why this might be useful.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at