Skip to content

Commit

Permalink
Use new Array constructor syntax in offset-arrays.md (#30626)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzamatB authored and StefanKarpinski committed Jan 7, 2019
1 parent 0bce3df commit 49b8e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/src/devdocs/offset-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ underlying "conventional" behavior you'd like, e.g., `Array{Int}` or `BitArray`
a convenient way of producing an all-zeros array that matches the indices of A is simply `zeros(A)`.

Let's walk through a couple of explicit examples. First, if `A` has conventional indices, then
`similar(Array{Int}, axes(A))` would end up calling `Array{Int}(size(A))`, and thus return
`similar(Array{Int}, axes(A))` would end up calling `Array{Int}(undef, size(A))`, and thus return
an array. If `A` is an `AbstractArray` type with unconventional indexing, then `similar(Array{Int}, axes(A))`
should return something that "behaves like" an `Array{Int}` but with a shape (including indices)
that matches `A`. (The most obvious implementation is to allocate an `Array{Int}(undef, size(A))` and
Expand Down

0 comments on commit 49b8e91

Please sign in to comment.