Skip to content

Commit

Permalink
doc: fix usage of NTuple{T}
Browse files Browse the repository at this point in the history
  • Loading branch information
stev47 committed Sep 9, 2018
1 parent ecff881 commit 40e306d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/src/manual/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ ourselves, we can officially define it as a subtype of an [`AbstractArray`](@ref
| `length(A)` | `prod(size(A))` | Number of elements |
| `similar(A)` | `similar(A, eltype(A), size(A))` | Return a mutable array with the same shape and element type |
| `similar(A, ::Type{S})` | `similar(A, S, size(A))` | Return a mutable array with the same shape and the specified element type |
| `similar(A, dims::NTuple{Int})` | `similar(A, eltype(A), dims)` | Return a mutable array with the same element type and size *dims* |
| `similar(A, ::Type{S}, dims::NTuple{Int})` | `Array{S}(undef, dims)` | Return a mutable array with the specified element type and size |
| `similar(A, dims::Dims)` | `similar(A, eltype(A), dims)` | Return a mutable array with the same element type and size *dims* |
| `similar(A, ::Type{S}, dims::Dims)` | `Array{S}(undef, dims)` | Return a mutable array with the specified element type and size |
| **Non-traditional indices** | **Default definition** | **Brief description** |
| `axes(A)` | `map(OneTo, size(A))` | Return the `AbstractUnitRange` of valid indices |
| `Base.similar(A, ::Type{S}, inds::NTuple{Ind})` | `similar(A, S, Base.to_shape(inds))` | Return a mutable array with the specified indices `inds` (see below) |
| `Base.similar(A, ::Type{S}, inds::NTuple{<:Any,Ind})` | `similar(A, S, Base.to_shape(inds))` | Return a mutable array with the specified indices `inds` (see below) |
| `Base.similar(T::Union{Type,Function}, inds)` | `T(Base.to_shape(inds))` | Return an array similar to `T` with the specified indices `inds` (see below) |

If a type is defined as a subtype of `AbstractArray`, it inherits a very large set of rich behaviors
Expand Down

0 comments on commit 40e306d

Please sign in to comment.