-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
HacktoberfestGood for Hacktoberfest participantsGood for Hacktoberfest participantsdocsThis change adds or pertains to documentationThis change adds or pertains to documentation
Description
As discussed here, the outer-only constructor SummedArray(a::Vector{T})
is actually an inner constructor. Shall we pick up a better name or add some additional info for clarification?
julia> struct SummedArray{T<:Number,S<:Number}
data::Vector{T}
sum::S
function SummedArray(a::Vector{T}) where T
S = widen(T)
new{T,S}(a, sum(S, a))
end
end
julia> SummedArray(Int32[1; 2; 3], Int32(6))
ERROR: MethodError: no method matching SummedArray(::Array{Int32,1}, ::Int32)
Closest candidates are:
SummedArray(::Array{T,1}) where T at none:5
tkoolen
Metadata
Metadata
Assignees
Labels
HacktoberfestGood for Hacktoberfest participantsGood for Hacktoberfest participantsdocsThis change adds or pertains to documentationThis change adds or pertains to documentation