Should range foreach be iterating over an implicit copy?

Jonathan M Davis jmdavisProg at gmx.com
Thu May 17 19:03:58 PDT 2012


On Friday, May 18, 2012 01:04:35 Erik Jensen wrote:
> I would be very much in support of having ranges and containers
> be distinct, with a standard way to get a range from a container.
> Something very similar is done in C#, where containers have a
> getEnumerator() method. The enumerator itself has a Current
> property and moveNext method (similar to front and popFront of a
> range), and thus is consumed as you use it. In my experience,
> this system works very well.

opSlice is the standard way to return a range from a container.

- Jonathan M Davis


More information about the Digitalmars-d mailing list