On Mon, Oct 29, 2012 at 4:40 AM, David Kimmel <davidwkimmel@gmail.com> wrote:
Is there a function in BOOST, given a starting point and a desired size, that
returns iterators for a (sub) range?


There are two classes in Boost.Range that achieve this purpose. The first, boost::iterator_range<Iterator> can be used to hold sub-ranges. It is not directly constructible from the form firstIterator, count since this would either require that the Iterator is a model of the RandomAccessConcept or would provide sloppy performance guarantees. This behaviour is easily achieved by constructing the iterator_range with boost::make_iterator_range(boost::next(buffer.begin(), 4), buffer.end()). Additionally there is the boost::sub_range<Range> which is very similar to iterator_range except that it preserves const-ness of the parent range.
 
http://www.boost.org/doc/libs/1_51_0/libs/range/doc/html/range/reference/utilities/iterator_range.html
http://www.boost.org/doc/libs/1_51_0/libs/range/doc/html/range/reference/utilities/sub_range.html


Thanks,

Regards,
Neil Groves