Stand-alone STL algorithms (like std::count_if
) take pair of iterators. In all cases where I use those (and in all examples I've seen online!), I find myself typing
std::count_if(myContainer.begin(),myContainer.end(), /* ... */ );
Is there a reason why shorthand templates of the style
std::count_if(myContainer, /* ... */ );
are not provided, given that more of than not is the operaation performed on the whole container? Did I just overlook it? Is the answer different for c++11 and c++03?