[Issue 4492] Version of take() which takes from the back of a range
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 22 16:43:19 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4492
--- Comment #10 from Jonathan M Davis <jmdavisProg at gmail.com> 2010-07-22 16:43:14 PDT ---
I wasn't aware that you could generally use subscripts on ranges such as
range[range.length - n .. range.length]
But I guess that it would make sense for random access ranges to have that, and
if you have to have a random access range to efficiently implement
takeBack()/takeTail() anyway, then you already have what you need. In that
case, the one argument that I'd make for takeTail() would be that it might be
better for generic code (it's also a bit cleaner to say takeTail(range, n)),
but if you're restricted to random access ranges for such code anyway, then it
probably doesn't really gain you anything since you can't really genericize
something that has to be specific.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list