|
Boost : |
From: Larry Evans (cppljevans_at_[hidden])
Date: 2003-11-20 11:50:45
On 11/20/2003 03:09 AM, AlisdairM wrote:
[snip]
> 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.
>
> Taking the example of a forward range. All we really need is a starting
> point (not sure there is a substitute for iterator here) and an 'end test'.
Another example is an "flattening" iterator over, for example, the
leaves of a tree or selected nodes in a tree. I needed this in
http://groups.yahoo.com/group/boost/files/shared_cyclic_ptr/stl_container.cpp
and used my own range iterator. It was implemented using begin/end
iterators, but the empty() method couldn't just compare two iterators.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk