[SR-14325] Support Strideable on finite enums. #56684
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: 3907fc2cf0862c6519998f5ec4e75d65
relates to:
Issue Description:
Current implementation of
Stride(To|Through)Iterable
relies on passing beyond the upper bound parameter_end
in order to detect the completion of the iteration.Given:
it is impossible to iterate to or through the last value, as it'd require a non-existant
five
(or a catch-all-unknown value) to exist in order to detect the completion of the iteration.It is for that reason that this calls crashes when
.three
is attempted to be advanced by2
:The resolution of SR-2016 SR-13883 solves a very similar issue when trying to deal with numeric type's frontiers by relying on
FixedWidthInteger
'smin
andmax
. This ticket is to find a way to extend this further so other types can stridden without requiring to represent otherwise-impossible values.The text was updated successfully, but these errors were encountered: