Skip to content

Commit ec2dc5e

Browse files
authored
update docstring of Size (JuliaArrays#1011)
1 parent ca50465 commit ec2dc5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/traits.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ function dimmatch end
2525
`Size` is used extensively throughout the `StaticArrays` API to describe _compile-time_
2626
knowledge of the size of an array. The dimensions are stored as a type parameter and are
2727
statically propagated by the compiler, resulting in efficient, type-inferrable code. For
28-
example, to create a static matrix of zeros, use `zeros(Size(3,3))` (rather than
29-
`zeros(3,3)`, which constructs a `Base.Array`).
28+
example, to create a static matrix of zeros, use `A = zeros(SMatrix{3,3})`. The static
29+
size of `A` can be obtained by `Size(A)`. (rather than `size(zeros(3,3))`, which returns
30+
`Base.Tuple{2,Int}`).
3031
3132
Note that if dimensions are not known statically (e.g., for standard `Array`s),
3233
[`Dynamic()`](@ref) should be used instead of an `Int`.

0 commit comments

Comments
 (0)