Is there a way to use yield blocks to implement an IEnumerator<T>
which can go backward (MoveLast()
) as well as forward?
Not directly from the iterator block, no.
However, the caller can always buffer the results, for example into a List<T>
, or just call Reverse()
- but this doesn't always apply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With