Skip to content

Commit

Permalink
Merge 4fd3332 into c97edbf
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 authored Aug 22, 2022
2 parents c97edbf + 4fd3332 commit 18e296a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "StaticArraysCore"
uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
version = "1.1.0"
version = "1.2.0"

[compat]
julia = "1.6"
Expand Down
5 changes: 5 additions & 0 deletions src/StaticArraysCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,9 @@ array operations as in the example below.
"""
abstract type FieldVector{N, T} <: FieldArray{Tuple{N}, T, 1} end

# Add a new BroadcastStyle for StaticArrays, derived from AbstractArrayStyle
# A constructor that changes the style parameter N (array dimension) is also required
struct StaticArrayStyle{N} <: Base.Broadcast.AbstractArrayStyle{N} end
StaticArrayStyle{M}(::Val{N}) where {M,N} = StaticArrayStyle{N}()

end # module
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ using StaticArraysCore, Test
@test StaticArraysCore.tuple_length((5, 3)) == 2
@test StaticArraysCore.tuple_prod((5, 3)) == 15
@test StaticArraysCore.tuple_minimum((5, 3)) == 3

@test StaticArraysCore.StaticArrayStyle{1}(Val(2)) === StaticArraysCore.StaticArrayStyle{2}()
end

0 comments on commit 18e296a

Please sign in to comment.