@@ -22,12 +22,30 @@ ProductSpace{S}(spaces::Vararg{S}) where {S<:ElementarySpace} = ProductSpace{S}(
22
22
function ProductSpace (spaces:: Tuple{S,Vararg{S}} ) where {S<: ElementarySpace }
23
23
return ProductSpace {S,length(spaces)} (spaces)
24
24
end
25
- function ProductSpace (space1:: S , rspaces:: Vararg{S} ) where {S <: ElementarySpace }
25
+ function ProductSpace (space1:: ElementarySpace , rspaces:: Vararg{ElementarySpace} )
26
26
return ProductSpace ((space1, rspaces... ))
27
27
end
28
28
29
29
ProductSpace (P:: ProductSpace ) = P
30
30
31
+ # constructors with conversion behaviour
32
+ function ProductSpace {S,N} (V:: Vararg{ElementarySpace,N} ) where {S<: ElementarySpace ,N}
33
+ return ProductSpace {S,N} (V)
34
+ end
35
+ function ProductSpace {S} (V:: Vararg{ElementarySpace} ) where {S<: ElementarySpace }
36
+ return ProductSpace {S} (V)
37
+ end
38
+
39
+ function ProductSpace {S,N} (V:: Tuple{Vararg{ElementarySpace,N}} ) where {S<: ElementarySpace ,N}
40
+ return ProductSpace {S} (convert .(S, V))
41
+ end
42
+ function ProductSpace {S} (V:: Tuple{Vararg{ElementarySpace}} ) where {S<: ElementarySpace }
43
+ return ProductSpace {S} (convert .(S, V))
44
+ end
45
+ function ProductSpace (V:: Tuple{ElementarySpace,Vararg{ElementarySpace}} )
46
+ return ProductSpace (promote (V... ))
47
+ end
48
+
31
49
# Corresponding methods
32
50
# -----------------------
33
51
"""
0 commit comments