
David Abrahams wrote:
Daniel Frey <daniel.frey@aixigo.de> writes:
I don't see any need to extend the legal use of next/prior to anything else than iterators.
It was already legal for non-iterators. What made you think otherwise?
The documentation and the way I was reading it :)
as the documentation only speaks about iterators and never bothers to mention non-iterators. Thus, the bug is IMHO that it's not explicitly documented that next/prior's first argument must meet the interator requirements.
Sorry, dude, I get final say on original intent, since it was mine.
Of course, but what's wrong with mentioning non-iterators explicitly? Or more generally writing down the requirements then? IIUC, you think that next/prior should work for all types that provide ++ and --, plus using + and - in cases where it's faster, right? (constant time complexity when possible, linear otherwise). Iterators being only one example of types that fulfill these requirements. Providing the implementation for next/prior in the documentation might be sufficient for the one-argument-version, but for the two argument version it's quite hard to help getting the implementation bug-free if I don't know what you intended. Can you write down original intent, please? Regards, Daniel -- Daniel Frey aixigo AG - financial solutions & technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de