|
Boost : |
Subject: Re: [boost] [filesystem] C++11 range-based for statement and BOOST_FOREACH support
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2012-07-13 12:42:04
> > I'm a little surprised to see a function that returns a range named
> > "directory_iterator".
> >
> > Other Boost libraries, such as Boost.Iterator and Boost.Range, distinguish
> > between the concepts of an iterator, which denotes a single position in a
> > range, and a range, which is defined by iterators at is beginning and its
> > end.
>
> directory_iterator is like std::istream_iterator in that a
> directory_iterator object identifies the end of a range simply by
> being equal to directory_iterator().
Existing practice in Boost seems to be to make a corresponding _range function
for such iterators, not to treat the iterator itself as a range:
http://www.boost.org/doc/libs/1_50_0/libs/range/doc/html/range/reference/ranges/istream_range.html
Regards,
Nate
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk