I'm fairly new to C++ and attempting to overload the < operator in a class.
In my header file I have:
friend bool operator<(const Tweet& a, const Tweet& b);
and in the class file I have:
inline bool Tweet::operator<(const Tweet& a, const Tweet& b) {
return (a.getID() < b.getID());
}
Currently I'm getting an error ‘bool Tweet::operator<(const Tweet&, const Tweet&)’ must take exactly one argument
Removing the Tweet::
changes the error to an undefined reference and removing the second argument changes the error to "must take exactly two arguments"
PS - I've tried following the appropriate section in Operator overloading as well as a few related questions but then I just get a variety of different errors.