3 ms·
The example you provide appears to be using the same type for both beginning and ending values, and would also appear to explicitly provide an ordering (<=). Ma
by ShroudedNight 6y ago
The example you provide appears to be using the same type for both beginning and ending values, and would also appear to explicitly provide an ordering (<=). Maybe I missed something, but that level of abstraction did not seem to be what was under indictment in the article, but rather scenarios where the types of first and last were disjoint, or the values were incomparable.
- tomjakubowski 6y agoRange<Idx> only has one type parameter. Thankfully, you really cannot have a range with an i32 on one end and a String on another. It's also not possible to call methods like contains() on Range<Idx> unless the type is (Partial?)Ord, because of the constraint on Idx in the impl which defines those methods.