Skip to content

Commit e3fa7b6

Browse files
authored
Permit non-number types in Accumulator (#860)
1 parent e62f469 commit e3fa7b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/accumulator.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#A counter type
22

33
"""
4-
Accumulator{T, V<:Number}
4+
Accumulator{T, V}
55
66
A accumulator is a data structure that maintains an accumulated total for each key.
77
The particular case where those totals are integers is a counter.
88
"""
9-
struct Accumulator{T, V <: Number} <: AbstractDict{T, V}
9+
struct Accumulator{T, V} <: AbstractDict{T, V}
1010
map::Dict{T, V}
1111
end
1212

1313
## constructors
1414

15-
Accumulator{T, V}() where {T, V <: Number} = Accumulator{T, V}(Dict{T, V}())
15+
Accumulator{T, V}() where {T, V} = Accumulator{T, V}(Dict{T, V}())
1616
Accumulator(map::AbstractDict) = Accumulator(Dict(map))
1717
Accumulator(ps::Pair...) = Accumulator(Dict(ps))
1818

0 commit comments

Comments
 (0)