|
Boost : |
From: Kevin S. Van Horn (kevin.vanhorn_at_[hidden])
Date: 2001-10-26 08:39:51
On Thu, 25 Oct 2001, Sean Parent wrote:
> 4. Generalized notion of range to a single "object". A range is an
> encapsulation of a pair of iterators (i.e. [iter1, iter2) is a range ). An
> array constitutes a range as do any of the STL containers. Push ranges
> through the STL containers and the algorithms.
How about generalizing even further: instead of specifying the end of
range by an iterator, allow an arbitrary function that takes an iterator
as argument. For example, in processing an array of characters, you could
then specify the end of the range either by a pointer, by a test for *it
== '\0', or by a function that returns true the first n-1 times it is
called and returns false the n-th time (to specify a range of length n).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk