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

Allow const and non-const reverse iterator comparisons #307

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

stephenswat
Copy link
Member

As @beomki-yeo discovered in acts-project/traccc#788, constant reverse iterators cannot be currently compared to non-constant reverse iterators as is required by the C++ standard in section [container.requirements.general]. This commit adds the necessary comparison code, and adds some tests for the new behaviour.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Member

@krasznaa krasznaa left a comment

Choose a reason for hiding this comment

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

The change in the comparison operators I like. But the tests should be trimmed down and prettied up a bit. 😉

tests/core/test_core_containers.cpp Outdated Show resolved Hide resolved
tests/core/test_core_containers.cpp Outdated Show resolved Hide resolved
tests/core/test_core_containers.cpp Outdated Show resolved Hide resolved
tests/core/test_core_containers.cpp Outdated Show resolved Hide resolved
@stephenswat stephenswat force-pushed the fix/nonconst_reverse_it branch 2 times, most recently from 2f19603 to 185e5ea Compare December 13, 2024 13:59
As @beomki-yeo discovered in
acts-project/traccc#788, constant reverse
iterators cannot be currently compared to non-constant reverse iterators
as is required by the C++ standard in section
[container.requirements.general]. This commit adds the necessary
comparison code, and adds some tests for the new behaviour.
@krasznaa krasznaa merged commit 3923928 into acts-project:main Jan 10, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants