Andrei Alexandrescu <[email protected]> wrote:

This is an annoying limitation of bidirectional ranges that we don't have a solid solution to. Let me put on the table the unacceptable solution as a baseline:

auto n = walkLength(r) - walkLength(until!pred(r));
popBackN(r, n);
reverse(r);

Of all ranges, bidirectional ranges suffer of this limitation because they clearly have two underlying "ends" that are inaccessible in separation from the range.

I seem to recall one of the original range RFCs you suggested some set
functions be applicable on (some) ranges, and as such
Range.allBefore( Range ) and its ilk should be possible. Was this
rejected, or is it merely my memory being adjusted by cosmic rays?

--
Simen

Reply via email to