I would like to have a word with whoever was responsible for the filesystem library in C++. Iterator objects are from the devil.
@john I'm just use to range listing and iterating like you do with arrays. I never liked the whole iterator pattern. It seemed like a waste.
@xianc78
"like you do with arrays"
I'm guessing you mean range-based for like
````
for ( auto dir_ent : dir.list() ) {
````
Yeah that would be fine and you could do that with a range.
But if you mean
````
for ( auto i = 0; i < dir_list.size(); ++i ) {
auto dir_ent = dir_list[i];
````
I have to think that's a bad idea. Think about what it would be like to implement dir_list in terms of `readdir` without allocating memory and scanning through the whole thing copying it over ahead of time.
@xianc78
You take issue with instantiating a sentinel object for end iterator?
Otherwise I would think a range for listing directories would be extremely similar.