-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insert! semantics when index > length(collection)+1 #7373
Comments
A BoundsError in that case sounds like a good idea. |
simonster
added a commit
that referenced
this issue
Jun 23, 2014
Ref #7373 Also fix return value of insert! to be the BitVector so it matches the behavior for Vectors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When
insert!(collection::Vector, index, item)
is passedindex
>length(collection)+1
,insert!
goes ahead and inserts the item, and the elements in between the old end of the vector andindex
are uninitialized memory. Personally I think it would be safer to throw a BoundsError for this case, but if we leave things as is, we should document this.The text was updated successfully, but these errors were encountered: