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

COMP: Simplify static array length checking #4575

Conversation

hjmjohnson
Copy link
Member

Use c++17 features to enforce compile-time
sanity checks on array lengths.

PR Checklist

@hjmjohnson hjmjohnson added the type:Style Style changes: no logic impact (indentation, comments, naming) label Apr 11, 2024
@hjmjohnson hjmjohnson self-assigned this Apr 11, 2024
@github-actions github-actions bot added type:Compiler Compiler support or related warnings type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:IO Issues affecting the IO module and removed type:Style Style changes: no logic impact (indentation, comments, naming) labels Apr 11, 2024
Use c++17 features to enforce compile-time sanity checks on array
lengths.
@hjmjohnson hjmjohnson force-pushed the simplify-static-array-length-check branch from c672055 to a320429 Compare April 11, 2024 23:35
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

😎

@thewtex thewtex requested a review from N-Dekker April 11, 2024 23:56
Copy link
Contributor

@N-Dekker N-Dekker left a comment

Choose a reason for hiding this comment

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

Strictly speaking, you'd need to #include <iterator> in order to use std::size. But apparently it is already #include'd indirectly.

Approved 👍 I leave it up to you if you still want to do #include <iterator>

@hjmjohnson hjmjohnson merged commit eb7d342 into InsightSoftwareConsortium:master Apr 12, 2024
13 checks passed
@hjmjohnson hjmjohnson deleted the simplify-static-array-length-check branch April 12, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:IO Issues affecting the IO module type:Compiler Compiler support or related warnings type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants