-
Notifications
You must be signed in to change notification settings - Fork 27
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
Custom linter: References should always be const
#70
Comments
While trying to fix this I noticed that there are a lot of non-const |
Good point - no, those should not be affected, as some of those require mutable references (e.g. |
Should I skip this check for all auto references since they include the constness from the return type or should I only skip it for iterator for loops? |
Do not skip it for anything else. The idea is that we want to make the |
I haven't seen a non-const reference around anywhere yet, non-const objects are handled with pointers instead. So the linter should complain when a non-const
T&
is seen around, because it is most likely wrong and should either be a pointerT*
, orconst T&
.The text was updated successfully, but these errors were encountered: