Check within struct building

How to add a check between elements of a structure?

For instance, how this example couold work?

struct paramChecked
  a::Real
  b::Real
  if(a>b)
    error("a > b")
  end
end

Thanks

here is the relevant section of the manual: https://docs.julialang.org/en/v1/manual/constructors/#Inner-Constructor-Methods-1

1 Like

Thank you.
Iā€™v already seen it but was not able to reuse it with several variable ; but now ok, so here is the minimal example I needed:

struct paramChecked
           a::Real
           b::Real
           c::Real
           d::Real
           e::Real
           paramChecked(a,b,c,d,e) = a > b || c < d ? error("out of order") : new(a,b,c,d,e)
end