Boost logo

Boost :

From: Matthew Wilson (stlsoft_at_[hidden])
Date: 2003-11-20 05:35:44


> The idea I am pushing for here is that ranges ARE NOT pairs of iterators.
> Rather, a pair of iterators happens to make a good representation of a
> range, but may not be the only one.

Yes, I heartily agree.

(As I said in a previous post) I think the fundamentals of a range support
should facilitate the following:

some_range_type r(. . .);

for(; r; ++r)
{
  *r; // Do something with the current position
}

This is very general, and therefore very powerful.

But to support such a "pure" range concept, we'd need mechanisms by which
those ranges that are implemented-in-terms-of iterators can use the standard
algorithms, whilst pure ranges use range-specific algorithms. I've not yet
considered whether the full gamut of current algorithms can be supported in
pure range form, though.

Matthew


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