Skip to content

Unclear documentation of checkbounds(::Bool, ...) #15671

@eschnett

Description

@eschnett

This function has the documentation

  checkbounds(::Type{Bool}, dimlength::Integer, index)

  Return a Bool describing if the given index is within the bounds of the
  given dimension length. Custom types that would like to behave as indices
  for all arrays can extend this method in order to provide a specialized
  bounds checking implementation.

I don't understand the term "dimension length".

I also don't understand how this helps defining a new type that can be used as index for all arrays -- wouldn't that require re-defining all array types' getindex functions?

Furthermore, there seems to be a function function checkbounds(::Type{Bool}, sz::Dims, I...) that is exported, but not documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis 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