Is the `in` operator @safe?

Dukc ajieskola at gmail.com
Tue Feb 12 08:10:42 UTC 2019


On Monday, 11 February 2019 at 21:47:05 UTC, Luís Marques wrote:
> Yet you can use `in` in @safe functions and keep the pointer 
> around. Is my assessment correct, or did I overlook anything? 
> If so, I'll open a bug report (I didn't find one already open 
> for that, but maybe I searched the wrong keywords).

I believe the memory referenced to by AA is garbage collected, 
not memory managed by ownership. As long as the memory you keep 
the pointer at is scanned by the collector, the AA content should 
not get freed.


More information about the Digitalmars-d mailing list