[Issue 11176] array.ptr in @safe code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 24 03:11:35 PST 2016


https://issues.dlang.org/show_bug.cgi?id=11176

Nick Treleaven <ntrel-pub at mybtinternet.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ntrel-pub at mybtinternet.com

--- Comment #8 from Nick Treleaven <ntrel-pub at mybtinternet.com> ---
(In reply to David Nadlinger from comment #2)
> The easiest fix would be to just disallow accessing the .ptr property in
> @safe code. There probably wouldn't be much reason to use it in the first
> place anyway.

Maybe, but it should be safe to allow comparing a .ptr with another pointer, so
long as .ptr is not dereferenced. So comparisons are fine, dereference should
be disallowed, and copying/escaping .ptr disallowed. I expect this may be worth
implementing to limit code breakage better than disallowing .ptr entirely.

--


More information about the Digitalmars-d-bugs mailing list