Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Utilities/lazy_iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Iterator over the elements of `data` mapped by `f`. This is similar to
`Base.Generator(f, data)` except that the `eltype` of a `LazyMap` is given at
construction while the `eltype` of `Base.Generator(f, data)` is `Any`.
"""
struct LazyMap{T, VT}
f::Function
struct LazyMap{T, VT, F}
f::F
data::VT
end
function LazyMap{T}(f::Function, data) where {T}
return LazyMap{T, typeof(data)}(f, data)
function LazyMap{T}(f, data) where {T}
return LazyMap{T, typeof(data), typeof(f)}(f, data)
end
Base.size(it::LazyMap) = size(it.data)
function Base.iterate(it::LazyMap, args...)
Expand Down