complement to $

Ellery Newcomer ellery-newcomer at utulsa.edu
Mon May 17 12:22:34 PDT 2010


On 05/17/2010 10:15 AM, Steven Schveighoffer wrote:
> On Mon, 17 May 2010 11:02:05 -0400, Ellery Newcomer
> <ellery-newcomer at utulsa.edu> wrote:
>>
>> Does your collections library allow for code like
>>
>> coll[coll.begin + 1 .. coll.end]
>
> No. begin and end return cursors, which are essentially non-movable
> pointers.
>
> The only collection where adding an integer to a cursor would be
> feasible is ArrayList, which does support slicing via indexes (and
> indexes can be added/subtracted as needed).
>

emphasis on the semantics (slice starting at second element), not the 
arithmetic, sorry.


More information about the Digitalmars-d mailing list