Is the `in` operator @safe?
Luís Marques
luis at luismarques.eu
Mon Feb 11 21:47:05 UTC 2019
After a quick look it seems like the `in` operator may return a
pointer that becomes invalid when an AA is resized:
https://github.com/dlang/druntime/blob/master/src/rt/aaA.d#L601
https://github.com/dlang/druntime/blob/master/src/rt/aaA.d#L114
https://github.com/dlang/druntime/blob/master/src/rt/aaA.d#L193
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).
More information about the Digitalmars-d
mailing list