Skip to content

Allow resizing of vectors at any position #57519

Description

@ameligrana

Resizing of vectors is currently supported only at the end (but after #57313 is merged, it will be possible to resize also at the start).

I think that having in the API something along the lines of resizeat!(a::Vector, n::Int, pos::Int) where pos indicates the position of the resizing makes sense (and similar for BitVector).

There is already an internal function to allow that for a Vector, i.e. _growat!, which has the nice property that the more you are near the extrema the more the resizing is faster.

Activity

  1. added
    arrays[a, r, r, a, y, s]
    featureIndicates new feature / enhancement requests
    on Feb 24, 2025
  2. jakobnissen commented on Feb 24, 2025

    @jakobnissen
    Member

    Good idea! If this is implemented, then it would be nice to also define insert!(::Vector, ::UnitRange, xs) to be a resize! followed by a copyto!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]featureIndicates new feature / enhancement requests

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions