Boost logo

Boost :

Subject: Re: [boost] [iterators] Proof-of-concept for a sentinel iterator adapter
From: John Maddock (john_at_[hidden])
Date: 2009-05-13 11:51:19


> Attached is proof-of-concept code for a sentinel iterator adapter. It
> turns a pointer to sentinel terminated sequence, such as a C-style
> string, into a forward iterator with a conforming end iterator.
>
> This is more efficient than doing a separate sequence traversal just to
> find the end.
>
> I'm a little surprised that Boost doesn't already have such an iterator
> adapter. Or am I just missing it?
>
> Would a production version of this iterator adapter be a worthwhile
> addition to Boost.Iterators?
>
> Any other comments appreciated,

Yes !!

Could be made even more generic as Joaquin noted, but other than that it
would make a very useful addition.

John.


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