Skip to content

Commit

Permalink
Added check for version number in structarray.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jecs authored Feb 15, 2024
1 parent d7c35aa commit 76148b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/structarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ function Base.deleteat!(s::StructVector{T}, idxs) where T
return StructVector{T}(t)
end

function Base.keepat!(s::StructVector{T}, idxs) where T
t = map(Base.Fix2(keepat!, idxs), components(s))
return StructVector{T}(t)
@static if VERSION >= v"1.7.0"
function Base.keepat!(s::StructVector{T}, idxs) where T
t = map(Base.Fix2(keepat!, idxs), components(s))
return StructVector{T}(t)
end
end

Base.copyto!(I::StructArray, J::StructArray) = (foreachfield(copyto!, I, J); I)
Expand Down

0 comments on commit 76148b1

Please sign in to comment.