Functor vs template parameters
问题 Is there any performance advantage to be had when using template parameters with static member functions instead of functor-style predicates?? For instance, a functor-style sort interface is typically something like this: template <typename _Type, typename _Pred> void sort ( RandomAccessIterator first, RandomAccessIterator last , _Pred less_than ) { // actual sorting code here, calling less_than()... } You could do something more like this, and require that _Pred contained a static member