Skip to content

Commit

Permalink
Fix EachAtom with N in type parameters, SVector in fields
Browse files Browse the repository at this point in the history
  • Loading branch information
singularitti committed Sep 19, 2023
1 parent 3fac109 commit 461f6c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/eachatom.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export eachatom

struct EachAtom{A,B}
atoms::Vector{A}
positions::Vector{B}
struct EachAtom{N,A,B}
atoms::SVector{N,A}
positions::SVector{N,B}
end

"""
Expand All @@ -21,8 +21,8 @@ function Base.iterate(iter::EachAtom, state=1)
end
end

Base.eltype(::EachAtom{A,B}) where {A,B} = Tuple{A,B}
Base.eltype(::EachAtom{N,A,B}) where {N,A,B} = Tuple{A,B}

Base.length(iter::EachAtom) = length(iter.atoms)
Base.length(::EachAtom{N}) where {N} = N

Base.IteratorSize(::Type{<:EachAtom}) = Base.HasLength()

0 comments on commit 461f6c6

Please sign in to comment.