More range woes: std.array.save is invalid

Jonathan M Davis jmdavisProg at gmx.com
Thu Dec 20 09:48:45 PST 2012


On Thursday, December 20, 2012 08:03:04 H. S. Teoh wrote:
> Because the definition of .save only requires that the state of the
> outer range is saved. Nothing is guaranteed about the state of the inner
> ranges.

That just means that that anything involving ranges of ranges needs to be 
written with the understanding that saving the outer range doesn't save the 
inner ones. So, we may have bugs with regards to this (similar to how we have 
bugs related to not calling save when we should), but there's still no problem 
with save itself - only with how it's used.

So much of this would have been easier though if reference type ranges had 
been disallowed. Too late now though. We'll just have to fix such bugs as we 
find them and strengthen the unit tests so that they get caught like they 
should be.

- Jonathan M Davis


More information about the Digitalmars-d mailing list