Primary Ranges of Containers

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 20 12:43:51 PDT 2012


On 6/20/12 11:03 AM, Jonathan M Davis wrote:
> On Wednesday, June 20, 2012 13:38:31 Timon Gehr wrote:
>> Escape the payload anyway and document that the range is invalid after
>> the container has been destroyed.
>
> That's a given anyway. Ranges from containers are _always_ invalid after the
> container that they come from is gone. They can also become invalid for a
> variety of operations on the container. That's why we have the stableX
> functions. So, there may be serious problems with a range over a const Array,
> but the invalidation of its range when the Array goes away is not one of them.

Actually supporting orphan ranges has been discussed and may make sense.

Andrei



More information about the Digitalmars-d mailing list