Dear all,
I’m defining a struct
struct foo{S, T}
val::NamedTuple{S}
end
where S is a tuple of Symbols and all the element of the NamedTuple are of type T.
Essentially, if S=(:1, :2), what we are looking at is a
NamedTuple{S, (T, T)}
Since the lenght of S is variable, how can I do something like
struct foo{S, T}
val::NamedTuple{S, T^(length(S))}
end
If I could use a mechanism similar to @generate, this would work fine, but it does not seem to work for structs.
Another question is about how can I force the type of S in the parameter, i.e., something like
struct foo{S::Tuple{Symbols}, T}
val::NamedTuple{S, T^(length(S))}
end
Thank everybody