Using type parameters in the types of the fields
Julia Programming Language
Using type parameters in the types of the fields
I’m not a data structures person, so the right answer here might be “you’re doing it wrong, try this instead”; but I’ll start with the immediate question I have: in a recursive type, is it not possible to have the type parameters of the fields be related to the type parameters of the struct itself? for example, if one were to try to define: struct Simplex{T<:Any, dim, size} x::Union{NTuple{size, Simplex{T, dim-1}}, T} end you get no method matching -(::Typevar, ::Int64). ▶ what I'm actual...
0 comments
No comments yet.