You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an iterator extension which performs an incremental calculation, yielding partial results along the way (technically a specialisation of scan).
I can easily implement ExactSizeIterator::len, provided the underlying iterator also implements it, but I cannot implement DoubleEndedIterator because that would require computing and caching all intermediate results.
I'm really not sure why rposition is even part of ExactSizeIterator; surely it should be an extension trait that requires both? Currently, it's presence prohibits implementing the len method which is the only part of ExactSize that might reasonably be expected to be there.
The text was updated successfully, but these errors were encountered:
I believe originally ExactSizeIterator was designed specifically to supplement DoubleEndedIterators. Somewhere along the way that stopped making complete sense.
I have an iterator extension which performs an incremental calculation, yielding partial results along the way (technically a specialisation of scan).
I can easily implement
ExactSizeIterator::len
, provided the underlying iterator also implements it, but I cannot implementDoubleEndedIterator
because that would require computing and caching all intermediate results.I'm really not sure why
rposition
is even part ofExactSizeIterator
; surely it should be an extension trait that requires both? Currently, it's presence prohibits implementing thelen
method which is the only part ofExactSize
that might reasonably be expected to be there.The text was updated successfully, but these errors were encountered: