# Simple compile-time evaluation for struct types

**URL:** <https://discourse.julialang.org/t/simple-compile-time-evaluation-for-struct-types/103326>\
**Category:** New to Julia\
**Created:** [August 29, 2023, 11:45am UTC](https://discourse.julialang.org/t/simple-compile-time-evaluation-for-struct-types/103326 "2023-08-29T11:45:16Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![RPS](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@RPS](https://discourse.julialang.org/u/RPS)\
**Post date:** [August 29, 2023, 11:45am UTC](https://discourse.julialang.org/t/simple-compile-time-evaluation-for-struct-types/103326/1 "2023-08-29T11:45:16Z")

</div>

I have a nested struct similar to the following:

```julia
struct A{N1, N2, T}
  a1::SVector{N1, T}
  a2::SVector{N2, T}
  b::B{N1, N2, T}
end

```

N1 and N2 are integers satisfying some simple (known) relationship, e.g. N2=N1+1. Therefore, I would like to ideally eliminate N2 as a parameter and replace it with a compile-time evaluation. How could I achieve something like the following invalid example?

```julia
struct A2{N1, T}
  a1::SVector{N1, T}
  a2::SVector{N1+1, T}
  b::B2{N1, T}
end

```

---

_[View the full topic](https://discourse.julialang.org/t/simple-compile-time-evaluation-for-struct-types/103326)._
