Scope Containers

bitwise bitwise.pvt at gmail.com
Tue Mar 12 21:06:17 UTC 2019


On Tuesday, 12 March 2019 at 18:06:39 UTC, Petar Kirov 
[ZombineDev] wrote:
> On Monday, 11 March 2019 at 20:02:05 UTC, Atila Neves wrote:
>>>
>>> <snip>
>>
>>> I see now that you can iterate by returning a scoped slice of 
>>> the internal data store, but this could be unsafe too. If you 
>>> called reserve on the container, the returned slice could end 
>>> up dangling if a non-gc allocator was used, even if the 
>>> returned slice was scoped.
>>
>> Unless there's a bug in my implementation or in dip1000, no, 
>> it can't be unsafe.
>
> I think that this is what @bitwise was talking about:
> https://github.com/atilaneves/automem/issues/25

I hadn't seen this, but yes, thanks.

    Bit


More information about the Digitalmars-d mailing list