
13 Jul
2012
13 Jul
'12
12:01 p.m.
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.