Summary: Version of take() which takes from the back of a range
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from Jonathan M Davis <> 2010-07-21 
16:41:01 PDT ---
Most of the functions that we have in phobos at this point seem to deal with
the front of a range rather than the back. Naturally, for a lot of stuff,
that's exactly what you want, and there _are_ ranges which don't have a back,
but for some functions, it would be nice to have a corresponding function which
acts on the back of a range. The one which immediately comes to mind is take().
There's no way to take the back n elements of a range.

There are ways to get more or less the same thing - you can copy the range and
then pop off elements from the front - but there are situations where taking
from the back of a range would be useful. So, I suggest that std.range have a
function named takeBack() - or something similar - which does the same thing as
take() except that it takes from the back of the range rather than the front.

Now, there may be reasons which I haven't thought of why this wouldn't work
very well (unlike take(), it obviously wouldn't work with infinite ranges), but
I would think that it would be useful enough to at least look into adding it.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to