How many parameters do I need for == overload?

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
I just answered this exact question in another thread. Here:

http://www.cplusplus.com/forum/beginner/129221/#msg697948
Topic archived. No new replies allowed.