Skip to content

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

@jishnub jishnub merged commit 563adeb into JuliaArrays:master May 20, 2025
17 of 24 checks passed
@jishnub jishnub deleted the jishnub/map_2term branch May 20, 2025 04:59
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