D-Programming-Language/phobos — pull request #991 by monarchdodra (2012-12-04 16:27:27+00:00)
Title: slice to end DollarToken object, and slicing to end with Sequence

From the (short) conversation at:

http://forum.dlang.org/thread/ehywdvmcmgyawgzfpytn@forum.dlang.org

This introduces an object called `DollarToken` (name subject to discussion), as a convenient dummy type to be used to slice to end.

I'm not 100% sure we want to deploy `DollarToken` publicly, but I don't think it should be re-defined by each range individually either, so maybe we can make it `package`?

--------
The pull also deploys it inside `Sequence`. The result is that sequence is now perfectly sliceable to end. Furthermore, given the new dev in `popFrontN`, dropping a sequence is now a o(1) operation! I've been wanting to do this for many months now >:D

I only touched `Sequence` as a prototype, but if we agree on this pull, I can expand the effort to add it to a few other ranges that could use it.

NOTE: Requires @jmdavis' #854 so that `hasSlicing!Sequence` replies true, but this does not otherwise restrain the functionality put forward here.