Skip to content

indexing with static vector #344

@SimonDanisch

Description

@SimonDanisch

I just tried to create a custom type inheriting from SVector and create a custom indexing behavior (getindex(A::AbstractArray, p::MyPoint)).
In theory, one just needs to overload:

Base.to_indices(A::AbstractArray, p::Tuple{<: Point}) = round.(Int, p[1].x)

To make this work, but because StaticArrays overloads getindex(A::AbstractArray, x::SVector) this doesn't work anymore.
Is this just wrongly overloading the getindex interface, or was there a reason to overload getindex directly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions