Page 1 of 1
POINT struct operators?

Posted:
Aug 5, 2003 @ 4:12am
by fzammetti

Posted:
Aug 5, 2003 @ 5:22pm
by meloditronic
From what I know, POINT is just a standard windows C struct. No overloaded operators. If you really need it, try this:
bool operator == (POINT &p1, POINT &p2)
{
return (p1.x==p2.x) && (p1.y==p2.y);
}

Posted:
Aug 5, 2003 @ 5:26pm
by fzammetti
Thanks for the reply, I wound up doing exactly that (geez, I think the code is identical to the letter!).
As per my original post, Johan, I offer this as a suggestion to add to the next release. I suspect comparing one POINT to another is a pretty common function, makes sense to be included I think.

Posted:
Aug 6, 2003 @ 9:46am
by Sm!rk

Posted:
Aug 6, 2003 @ 9:56am
by Johan

Posted:
Aug 6, 2003 @ 2:09pm
by fzammetti
Make it an option?

Posted:
Aug 6, 2003 @ 6:45pm
by mlepage
I'm not sure it's a good idea to unconditionally overload op== for POINTs in a library. Maybe make it a conditional option via a macro flag? Even if it's on by default, it lets us disable it if we need to.

Posted:
Aug 6, 2003 @ 6:55pm
by fzammetti