Orphan ranges

Walter Bright newshound2 at digitalmars.com
Sun Apr 15 17:53:33 PDT 2012


On 4/15/2012 11:43 AM, Walter Bright wrote:
> On 4/15/2012 9:34 AM, Andrei Alexandrescu wrote:
>> Built-in arrays work routinely like that, and in fact the originating arrays are
>> not distinguished by type in any way from their ranges (be they orphan or not).
>> The question is, what should std.container do about orphan ranges in general?
>> Should it allow them, disallow them, or leave the decision open (e.g. to be made
>> by the allocator)? Depending on what way we go, the low-level design would be
>> quite different.
>
> I suspect that disallowing them would be surprising behavior, as D with array
> slices supports it well.
>

I'd add that unless there's a pretty compelling reason not to, the collections 
should support orphan ranges.


More information about the Digitalmars-d mailing list