Skip to content

Conversation

@MillaFleurs
Copy link
Contributor

Proposed changes

Adding include-what-you-use per https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rs-implicit PR 3000

Checklist

Put an x in the boxes that apply.

  • [ X] I have read the CONTRIBUTING document
  • [X ] I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

Copy link
Collaborator

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think replacing dim < 0 ? dim + ndim() : dim with a utility function decreases code readability without actual benefits. Per IWYU please discuss at #3000.

@MillaFleurs
Copy link
Contributor Author

I think replacing dim < 0 ? dim + ndim() : dim with a utility function decreases code readability without actual benefits. Per IWYU please discuss at #3000.

See PR 2993 on that question. The line you're referring to fixed a bug which is the actual benefits. Sorry I was not clear on that part. I thought I had reset my git repo to match the current version on GitHub so that it would be a different patch but I appear not to have done that correctly. Mea Culpa.

Regarding the changes in this PR (besides PR 2993), they are arguably bugs in that if you were to compile and there is a missing an include it would throw an error. Yes it's a minor inconvenience as presumably one would see the compile error and add the missing include but IMHO good practice is to reduce potential defects where possible... Although I understand that may be a philosophical discussion for some. I am just trying to be helpful while spotting some issues, trying to familiarize myself with the codebase....

@zcbenz
Copy link
Collaborator

zcbenz commented Jan 18, 2026

The at() method of std::vector already throws for out-of-range access.

@MillaFleurs
Copy link
Contributor Author

@zcbenz Maybe discuss in #2993 ?

@awni
Copy link
Member

awni commented Jan 20, 2026

Closing this as it was fixed in #2994 and the iwyu is not planned

@awni awni closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants