More pathological range subtleties

Benjamin Thaut code at benjamin-thaut.de
Tue Feb 12 12:47:51 PST 2013


Am 12.02.2013 21:43, schrieb H. S. Teoh:

> There are two levels of ranges going on here. The outer range's .front
> is what gets assigned to ref e, and when you call e.popFront, it indeed
> changes the slice returned by the outer range's .front. However, the
> problem is that the outer range's .front *always* creates a new slice of
> the underlying array, and it never keeps track of older slices. So no
> matter what you do with the slice returned by .front, it doesn't change
> the outer range at all, and .front will continue to return a slice over
> the same elements -- the e.popFront has no effect on it.
>
>
> T
>

Yeah your right, didn't see that.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list