Skip to content

[doc] rename outer-only constructors? #23022

@Gnimuc

Description

@Gnimuc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestGood for Hacktoberfest participantsdocsThis change adds or pertains to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions