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 some array/iterator functions to the stdlib #831

Closed
jfecher opened this issue Feb 13, 2023 · 0 comments · Fixed by #833
Closed

Add some array/iterator functions to the stdlib #831

jfecher opened this issue Feb 13, 2023 · 0 comments · Fixed by #833
Labels
enhancement New feature or request

Comments

@jfecher
Copy link
Contributor

jfecher commented Feb 13, 2023

Problem

Now that we have higher order functions we can support functions like map and fold for arrays which lessens the need for repetitive for loops.

Solution

Add these functions to the std::array module. Note that because we cannot dynamically grow arrays the only way to produce a new array of type [T; N] would be to take an existing element of the original array and replicate it N times, then mutate from there. This assumes the original array is of at least length 1. This should be a fine assumption currently as we assume all arrays are non-empty still.

@jfecher jfecher added the enhancement New feature or request label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant