This is another case in point for my claim up there that the STL should offer ranges instead of — or at least as well as — iterators.
Given range support, especially if containers themselves presented the range concept, the algorithms that currently accept a pair of iterators would all accept a range and your std::count_if example would work out of the box.
Now that C++11 is out there, I'm seriously considering putting some concrete proposals in for the next revision of C++, including ranges.
Given range support, especially if containers themselves presented the range concept, the algorithms that currently accept a pair of iterators would all accept a range and your std::count_if example would work out of the box.
Now that C++11 is out there, I'm seriously considering putting some concrete proposals in for the next revision of C++, including ranges.