Why is there no Span::MIN or Span::MAX?
#415
-
|
Why is there no Originally posted by @jessekrubin in jessekrubin/ry#229 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Unlike a To be clear, Jiff could provide a |
Beta Was this translation helpful? Give feedback.
Unlike a
SignedDurationwhich is just a single 96-bit integer number of nanoseconds, aSpanis a more complicated type that keeps track of each individual unit separately. In theory, you could express a maximalSpanby building aSpanusing the maximum supported values for each unit. But I think this is somewhat odd, and it's not clear if there is a good use case for it. Moreover, aSpanitself doesn't supportEqorOrdcomparisons directly, and instead you must callSpan::compare. In part so that time zones/varying quantities can be handled, but also because real work needs to be done to normalize the twoSpans being compared. For example,120.minutes()versus2.hours(). These are distin…