
13 May
2009
13 May
'09
3:51 p.m.
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.