Hello. I would like a simpler way to do something like this:
class C {
....
bool operator<(const C&) const;
};
int main()
{
std::vector<C*> v;
...
C* x = max_element(v.b egin(),v.end()) ;
}
without having to write this:
bool operator<(const C* a, const C* b)
{ return *a<*b; }
class C {
....
bool operator<(const C&) const;
};
int main()
{
std::vector<C*> v;
...
C* x = max_element(v.b egin(),v.end()) ;
}
without having to write this:
bool operator<(const C* a, const C* b)
{ return *a<*b; }
Comment