struct{N} with internal NTuple{N,Int32}


#1

I would like to use something like this:

struct Digits{N} <: Signed
     digits::NTuple{N, Int32}
     # ...
end

There can be many distinct values of N. Is there an approach which allows me the internalized tuple and does not risk overwhelming lower level system stuff when there are several hundred of distinct values of N in use?


#2

What does this mean? Are you afraid that too many functions are getting specialized?


#3

yes – exactly (the full complement of arithmetic ops, at least)

Is there any specialization that occurs with, say,
(+)(a::Struct{N}, b::Struct{M}) and N != M?
or does that occur only if the two are promoted to a single param value?