Skip to content

zero function for StaticArrays #233

@vavrines

Description

@vavrines

Not sure whether this has been reported, and wonder if there is a solution already.
The function zero on an OffsetArray with the substance from StaticArrays results in a general Vector though.

julia> using OffsetArrays, StaticArrays

julia> a=@MVector [1,2,3]
3-element MVector{3, Int64} with indices SOneTo(3):
 1
 2
 3

julia> a1=OffsetArray(a,0:2)
3-element OffsetArray(::MVector{3, Int64}, 0:2) with eltype Int64 with indices 0:2:
 1
 2
 3

julia> zero(a1)
3-element OffsetArray(::Vector{Int64}, 0:2) with eltype Int64 with indices 0:2:
 0
 0
 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions