3 ms·
I guess if you're doing something like the original post's "type Iterator[V] struct" you could somehow extend it capture the extra information to make an effici
by dilap 2y ago
I guess if you're doing something like the original post's "type Iterator[V] struct" you could somehow extend it capture the extra information to make an efficient Reverse work.
(FWIW, in C#, the IEnumerable extension method Reverse() just captures the whole sequence to an array and then iterates it in reverse. And yeah, woe unto you if you try to reverse an infinite sequence.)