Skip to content

Specialize map!(f, array) #1307

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented May 13, 2025

Julia v1.12 introduces the 2-term map!, where the source and the destination are identical. Currently, this package errors without a third term, as it can't find the source array. This PR ensures that the method works for StaticArrayss.

After this,

julia> M = MVector(1,3,4)
3-element MVector{3, Int64} with indices SOneTo(3):
 1
 3
 4

julia> map!(x->x^2, M)
3-element MVector{3, Int64} with indices SOneTo(3):
  1
  9
 16

julia> M
3-element MVector{3, Int64} with indices SOneTo(3):
  1
  9
 16

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.

2 participants