-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Description
Line 32 in 3a9291d
@generated function (::Type{SArray{S, T, N}})(x::Tuple) where {S <: Tuple, T, N} |
in above I see the use of generated function for outer constructors.
what is the difference (and disadvantage) using the following instead?
SArray{S, T, N}(x::Tuple) where {S<:Tuple, T, N} = SArray{S, T, N, tuple_prod(S) }(x)
also, in
StaticArrays.jl/src/SDiagonal.jl
Line 11 in 3a9291d
@inline (::Type{SDiagonal{N,T}})(a::Tuple) where {N,T} = Diagonal(SVector{N,T}(a)) |
why don't we define the following?
@inline SDiagonal{N,T}(a::Tuple) where {N,T} = Diagonal(SVector{N,T}(a))
thanks.