Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2003-04-20 11:02:39


David Abrahams wrote:

> While at the ACCU and committee meeting, Jeremy, Thomas and I did a
> whole bunch of work on the sandbox version of iterator adaptors and
> the new categories in boost/iterator and libs/iterator. We think that
> the implementations are quite stable now and are trying to get a
> proposal together for the post-meeting mailing. Please check it out
> and see how it works for you! We'd value your comments.

Comment on the docs, so maybe a little premature (or even wrong, as I am
no algorithm expert <g>)

The various sort algorithms (sort, stable_sort etc) are documented as
changing requirements from
  Random Access Iterator
to
  Random Access Traversal Iterator and Swappable Iterator

Would they not also need to dereference the value of the iterator for
comparisons, also requiring Readable Iterator?

I checked if this was implied by Swappable Iterator but again the doc
states:
"Note: Readable Iterator and Writable Iterator combined implies
Swappable Iterator because of the fully templated std::swap(). However,
Swappable Iterator does not imply Readable Iterator nor Writable
Iterator."

so it sounds like an extra requirement to me.

However, there are some algorithms in that box that I can see
implementable with the requirement as stated (eg random_shuffle) so I
may be missing some neat implementation techniques. (I rarely rule out
my own ignorance <G>)

-- 
AlisdairM

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