It doesn't make sense to have enumerated types implement num::One
, num::Zero
, or std::ops::Add
.
#1
Labels
enhancement
New feature or request
The convenience constructors (e.g.
closed
orall
) were originally designed for numeric types. The same traits used for numeric types do not work well with enumerated types. A better set of traits would includestd::iter::Step
(available only with nightly) andstd::default::Default
. Thenum::Bounded
trait could still be used, but it might be a little confusing because enumerated types are not numeric.Workarounds:
Segment
struct does not require the use of convenience constructors to operate correctly (they are there for convenience). If your type cannot implementnum::One
,num::Zero
, orstd::ops::Add
, then just use thenew
constructor which makes a closed-open interval.The text was updated successfully, but these errors were encountered: