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

Add generic initializers for statically-dimensioned array types #1385

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thatcomputerguy0101
Copy link

@thatcomputerguy0101 thatcomputerguy0101 commented May 11, 2024

This takes advantage of const generics to provide general initializers for the statically-dimensioned array types. (2-6 dimensions, with the current implementations). This reduces the reliance on macros for array initialization, and enables other crates to operate more succinctly when working with an unknown-dimension static array type. I'm unsure how well this fits with the existence of the dynamic array index implementation, and the name of the new type alias IxD is open for discussion. No additional test cases have been implemented for this functionality yet.

@bluss
Copy link
Member

bluss commented May 12, 2024

Hm, new clippy lints should be fixed in a different PR, I think

@thatcomputerguy0101
Copy link
Author

I originally decided on the name IxD to match the style of Ix0, Ix1, etc..., but with a generic D instead of a fixed value. It is also short, which helps in its usability as a convenience type (since it is an alias for Dim<[Ix, D]>). However, its name is close to IxDyn, and I have concerns about possible confusion between those two.

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.

None yet

2 participants