Passing functors to standard algorithms
I'm not sure entirely what you're asking. If you're asking for which of three is "better" code between:

int x = count_if(vec.begin(), vec.end(), [](int x) {return x &lt; 6; });
int y = count_if(vec.begin(), vec.end(), lessThan&lt;6&gt;);
int z = count_if(vec.begin(), vec.end(), LessThan(6));


I would say x then z then y. The reason for this is that the lambda solution is the only one where the actual functor is in-line with the algorithm. Anybody reading that code knows exactly what x should be immediately. There is no question. It is clear (to the extent that lambda syntax is) and concise. 

z would be the C++03 way of doing this thing. It's... ok. We wrote that code for many years. The problem is the body of the functor is often hundreds of lines removed from the call, maybe in a different file... so readers of your code will have to find it. And it's never going to be perfectly clear either (who knows, maybe you named your functor weird and it's returning 6 &lt; x? Naming things is really hard)

y is the worst. Having 6 as a template argument adds nothing to your performance (it's not like you're optimizing out a comparison), has equal readability loss compared to the lambda with the functor, and on top of that, can't even be called with a variable. With the other two, I can easily write:

int threshold = get_threshold();
int x = count_if(vec.begin(), vec.end(), [=](int x) {return x &lt; threshold; });
int z = count_if(vec.begin(), vec.end(), LessThan(threshold));


But there's no way to pass threshold in as a template.

Typically, for algorithms, strongly prefer lambda unless (1) the algorithm call is a small part of the function and (2) the functor is very long and complicated. I say both must be met because something like this is still perfectly acceptable in my opinion:

int countBySomeCriteria() {
    return count_if(vec.begin(), vec.end(), [=](Foo const&amp;) {
        /* some 15 line complicated functor */
    });
}


whereas if that call were surrounded by a lot of other logic, it would be much harder to easily make out. 

Lambdas got added to the language basically to make stuff like this easier to write and easier to read. You should use them because they succeed in that goal. 



PS. There is a fourth way to pass a functor: the lambda that was a lambda before C++11 lambdas: Boost.Lambda:

int q = count_if(vec.begin(), vec.end(), _1 &lt; 6);


Make of that what you will.