complement to $

Ellery Newcomer ellery-newcomer at
Mon May 17 08:02:05 PDT 2010

On 05/14/2010 08:20 AM, Steven Schveighoffer wrote:
> Currently, D supports the special symbol $ to mean the end of a
> container/range.
> However, there is no analogous symbol to mean "beginning of a
> container/range". For arrays, there is none necessary, 0 is always the
> first element. But not all containers are arrays.
> I'm running into a dilemma for dcollections, I have found a way to make
> all containers support fast slicing (basically by imposing some
> limitations), and I would like to support *both* beginning and end symbols.
> Currently, you can slice something in dcollections via:
> coll[coll.begin..coll.end];
> -Steve

Does your collections library allow for code like

coll[coll.begin + 1 .. coll.end]


More information about the Digitalmars-d mailing list