On 8/25/10 14:09 PDT, Simen kjaeraas wrote:
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?

Your memory is accurate. I opted for going with the simplest interface and add stuff only if need arises later. Well, now seems to be later :o).

Andrei

Reply via email to