Roman Perepelitsa <roman.perepelitsa <at> gmail.com> writes:...
> class Compare
{
> public:
> Compare (int i) : _i(i){}
> //this does not compile, but what's the proper way to define
> // function object for the sort method in ptr_vector?
> bool operator<(const A& v1, const A& v2)
> {
> return (v1.i > v2.i) &&(_i != 1);
> }
};No, it did not work. Complains that
>
> Try making your operator const:
> bool operator<(const A& v1, const A& v2) const
>
> Roman Perepelitsa.
binary 'operator <' has too many parameters