Skip to content

trait type to distinguish generic offset array and one based indexing array #326

@johnnychen94

Description

@johnnychen94

Traits like this might be helpful to be kept in ArrayInterfaceCore

struct GenericIndexing end
struct OneBasedIndexing end

offset_type(::Array) = OneBasedIndexing()
offset_type(::OffsetArray) = GenericIndexing()
offset_type(A::Diagonal) = offset_type(parent(A))

CRef: https://discourse.julialang.org/t/does-abstractarray-itself-need-to-support-indexing-beyond-1-based/83324/3

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