1 2 3 4 5 6 7 8 9 10
|
class point_c {
public:
numeric_t x, y;
inline bool operator == (const point_c & p1, const point_c & p2) {return (p1.x==p2.x) && (p1.y==p2.y);}
inline bool operator != (const point_c & p1, const point_c & p2) {return (p1.x!=p2.x) || (p1.y!=p2.y);}
};
|
This is what is suggested by many web pages to overload == and !=, but the compiler said this function can only have one parameter, why? Thanks.
Last edited on