Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2004-02-24 04:14:19


David Abrahams wrote:
> Daniel Frey <daniel.frey_at_[hidden]> 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_at_[hidden], web: http://www.aixigo.de

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