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?
There is a nice blog-post by Herb Sutter discussing the question. The gist is that adding container-based overloads for algorithms can create ambiguities if an overload for that algorithm with the same number of template-parameters already exists. Concepts were intended to fix that problem.