Skip to content
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

Pass by const reference #220

Open
willGraham01 opened this issue Jan 25, 2023 · 2 comments
Open

Pass by const reference #220

willGraham01 opened this issue Jan 25, 2023 · 2 comments
Labels
enhancement New feature or request housekeeping Code cleanup

Comments

@willGraham01
Copy link
Collaborator

We should run through the codebase and check that we are not unnecessarily passing non-const references to objects that we do not edit, and conversely mark appropriate class methods as const.

Culprits for investigation are the classes in field.h, arrays.h, and the various single-class header files.

@samcunliffe
Copy link
Member

Really good for this kind of thing is cppcheck which is (unfortunately) very slow (...and therefore not really suitable for a CI/regular-use linter #41).

@samcunliffe
Copy link
Member

... I just ran cppcheck over your feature branch for #215 and it's not as bad as I was expecting. Also doesn't seem to pick up many passedByValue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request housekeeping Code cleanup
Projects
None yet
Development

No branches or pull requests

2 participants