Original Post
Hi
I tried:
Didn't compile on VS.NET -> "too many template arguments."
But why? std::sort does have a template version that takes an iterator and a predicate type. Could somebody help? I am trying to avoid passing the predicate by value for efficiency consideration.
edit: the template parameters inside the less than greater than brackets were not shown. added the source tag section
[edited by - surabaya on October 6, 2002 11:00:31 AM]
[edited by - surabaya on October 6, 2002 11:01:54 AM]
[edited by - surabaya on October 6, 2002 11:10:54 AM]
...
Functor func; // a functor object
typedef std::vector<long> Array;
Array arr;
...
std::sort<Array::iterator, Functor&>( arr.begin(), arr.end(), func );