Original Post
I have templated Sorted List class that I wrote. The class works fine when I use a primitive data type(int , char, …), but if I create I list of a class that I made it gives me this error
error C2678: binary ''<='' : no operator defined which takes a left-hand operand of type ''const class CCollision'' (or there is no acceptable conversion)
it looks like there must be something wrong with the way I have the operators overloaded for the class.
Here is the class
class CCollision {
public:
double time;
bool operator==(const CCollision& c) {
return time == c.time;
}
bool operator>(const CCollision& c) {
return time > c.time;
}
bool operator<(const CCollision& c) {
return time < c.time;
}
bool operator>=(const CCollision& c) {
return time >= c.time;
}
bool operator<=(const CCollision& c) {
return time <= c.time;
}
};
Thanks for any help.