I am getting a strange build error message when creating a simple STL map.
"stl_function.h passing `const CWord508' as `this' argument of `bool CWord508:perator<(CWord508)' discards qualifiers"
The error is triggered on the map.insert(<key object, other object> line
I have provided a operator < function on the key object class:
class CWord508 {
char str[20];
public:
CWord508();
CWord508( char *s );
char *get();
// must define operator "less than" for CWord508 objects
bool operator<( CWord508 a);
bool operator==( CWord508 a);
};
the c++ code is in separate file:
bool CWord508:perator<( CWord508 a)
{
return (strcmp( str, a.get() ) < 0 );
}
I cannot see an obvious flaw with the code; any help / suggestions welcome.
NB I have tried providing operator> as well just in case.
Thanks