Incomplete initialization (control which fields are initialized in `new`)

Given that you are using numeric types, I would go with zero(T) or similar — if I understand correctly, :unbounded in your code makes sure that the actual value won’t be used anyway.

That said, I would just use different types for left/right unbounded intervals. I don’t know your application, but generally they require different approaches in most algorithms anyway, so you could just dispatch accordingly.

1 Like