-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Make point and tripoint abs functions into methods. #40106
Conversation
@@ -72,6 +72,12 @@ struct point { | |||
return point( x / rhs, y / rhs ); | |||
} | |||
|
|||
#ifndef CATA_NO_STL | |||
inline point abs() const { |
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.
inline
is redundant; definitions inside the class definition are implicitly inline
.
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.
Gah, the whole mandatory inline thing for non-members keeps tripping me up, will fix.
Summary
SUMMARY: None
Purpose of change
As a minor cleanup, avoid using an essentially reserved keyword "abs" in the global namespace.
Describe the solution
Create point::abs() and tripoint::abs() and use them instead of abs( point ) and abs( tripoint ).
Describe alternatives you've considered
Renaming from abs to something else.
Namespacing the functions.
Ignoring it.
Testing
If it builds it should be fine.