Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-02-21 08:29:16


----- Original Message -----
From: "Michiel Salters" <Michiel.Salters_at_[hidden]>

> Is there a reason you want to have an end iterator, instead of an
> at_end( iterator ) function ? Implementing the latter in terms of the
> former is trivial, but all you have is the at_end( ) functionality, you
> need a special singular iterator to signal at_end( ), which can make
> all iterators bigger. Furthermore, for many output iterators, at_end( )
> is trivially implemented as "return false;". The corresponding
> iterator is much more work.

I can think of several huge problems with at_end():

* How do you iterate over a subrange?
* Is a pointer still an iterator? How do you write at_end() for pointers?

-Dave


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