Boost logo

Boost :

Subject: Re: [boost] [filesystem] C++11 range-based for statement and BOOST_FOREACH support
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-07-13 08:01:58


On Friday 13 July 2012 07:55:13 Beman Dawes wrote:
>
> I don't see any abuse of begin() and end(). They were put in the core
> language's list of ways to enable range-base for so that there would
> be no need to add the complication of a separate class plus a
> make_x_range function to handle cases like this. Unless I'm missing
> something, adding wrappers the user must use increases complexity and
> reduces teachability without adding additional functionality. The
> beauty of begin/end free functions is that the user doesn't even have
> to know they exist - range-based for "just works".

The user has to know that directory_iterator is special and can be used as a
range. This doesn't simplify teaching. At least, not for me.


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