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

**URL:** <https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070>\
**Category:** Performance\
**Created:** [March 30, 2018, 10:48am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070 "2018-03-30T10:48:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 30, 2018, 10:48am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070/1 "2018-03-30T10:48:04Z")

</div>

I would like to use something like this:

```julia
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?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 30, 2018, 11:03am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070/2 "2018-03-30T11:03:01Z")

</div>

> [@JeffreySarnoff](#):
>
> overwhelming lower level system stuff

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

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 30, 2018, 11:09am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070/3 "2018-03-30T11:09:41Z")

</div>

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?
