@@ -29,6 +29,10 @@ struct SizedArray{S<:Tuple,T,N,M,TData<:AbstractArray{T,M}} <: StaticArray{S,T,N
2929 end
3030end
3131
32+ # Julia v1.0 has some weird bug that prevents this from working
33+ @static if VERSION >= v " 1.1"
34+ @inline SizedArray (a:: StaticArray{S,T,N} ) where {S<: Tuple ,T,N} = SizedArray {S,T,N} (a)
35+ end
3236@inline function SizedArray {S,T,N} (
3337 a:: TData ,
3438) where {S,T,N,M,TData<: AbstractArray{T,M} }
@@ -123,6 +127,7 @@ Base.pointer(sa::SizedArray) = pointer(sa.data)
123127
124128const SizedVector{S,T} = SizedArray{Tuple{S},T,1 ,1 }
125129
130+ SizedVector (a:: StaticVector{N,T} ) where {N,T} = SizedVector {N,T} (a)
126131@inline function SizedVector {S} (a:: TData ) where {S,T,TData<: AbstractVector{T} }
127132 return SizedArray {Tuple{S},T,1,1,TData} (a)
128133end
142147
143148const SizedMatrix{S1,S2,T} = SizedArray{Tuple{S1,S2},T,2 }
144149
150+ # Julia v1.0 has some weird bug that prevents this from working
151+ @static if VERSION >= v " 1.1"
152+ SizedMatrix (a:: StaticMatrix{N,M,T} ) where {N,M,T} = SizedMatrix {N,M,T} (a)
153+ end
145154@inline function SizedMatrix {S1,S2} (
146155 a:: TData ,
147156) where {S1,S2,T,M,TData<: AbstractArray{T,M} }
0 commit comments