Operation with struct parameter within struct definition

From one of the “Related” threads that Discourse suggested below here:

Still uses an extra type parameter, but the constructor definition neatly makes it so that the redundant parameter doesn’t have to be explicitly given during struct instance initialization.

Another related thread recommended GitHub - vtjnash/ComputedFieldTypes.jl: Build types in Julia where some fields have computed types

1 Like