
24 Feb
2004
24 Feb
'04
1:01 a.m.
Bjorn.Karlsson@readsoft.com writes:
From: David Abrahams [mailto:dave@boost-consulting.com] 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 www.boost-consulting.com