I'm getting the error invalid operands to binary expression
when I try to compile a project that uses std::sort.
I'm using std::sort like this:
vector <record> vrec;
...
sort(vrec.begin(), vrec.end());
I've already overloaded the < operator like this:
bool operator< (record &r1, record &r2) { ... }
And this is a excerpt of the error message I get:
invalid operands to binary expression ('const record' and 'const record')
operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
~~~ ^ ~~~