-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Add explicit to bool operators of Point and Rect #4948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Did you forget the one on |
surprisingly, there isn't one there. Want me to add one in? |
Eh, only if you need it. |
Or whatever, I see you already did. It's fine. |
zadjii-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait could we add a test for the case you explicitly put in the description?
Doing something like this: const til::point pt{ 1, 1 };
COORD cd{ pt };won't even compile. So, I think there isn't a way we can test it. |
zadjii-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well that'll do for me, thanks!
|
Hello @miniksa! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Found a bug where the following won't work:
COORD inclusiveEnd{ _end };where
_endis atil::point.The only fix for this is to replace these instances with this:
What was happening in the first notation is the implicit conversion of
til::pointtobooltoSHORT. The constructor for COORD only sees one SHORT so it thinks the value should be the definition for X, and Y should stay as 0. So we end up getting1, 0.By adding the explicit keyword to the bool operators, we prevent the accident above from occurring.