Skip to content

Commit

Permalink
implement AbstractVector inference for ConvergentsIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored Nov 16, 2021
1 parent a35f2a5 commit 24cb8a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gaussiannumbers/continued_fraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,13 @@ end
#
###############################################################################

struct ConvergentsIterator{T, R}
struct ConvergentsIterator{T, R} <: AbstractVector{R}
v::Vector{T}
end

Base.lastindex(it::ConvergentsIterator) = length(it.v)
Base.length(it::ConvergentsIterator) = length(it.v)
Base.eltype(::Type{ConvergentsIterator{T, R}}) where {T, R} = R
Base.eltype(it::ConvergentsIterator{T, R}) where {T, R} = R
Base.size(it::ConvergentsIterator) = size(it.v)
Base.collect(it::ConvergentsIterator{T, R}) where {T, R} = collect(R, it)

function Base.getindex(it::ConvergentsIterator{T, R}, n) where {T, R}
Expand Down

0 comments on commit 24cb8a9

Please sign in to comment.