[Issue 11176] array.ptr in @safe code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 21 08:00:55 PDT 2016


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

--- Comment #16 from Nick Treleaven <ntrel-pub at mybtinternet.com> ---
> it should be safe to allow comparing a .ptr with another pointer, so long as .ptr is not dereferenced

I think I've pushed this point enough. Instead I expect it is acceptable to add
a function to std.array:

void* pointer(T)(T[] arr) @trusted;

assert(arr.pointer is null); // @safe

Then although fixing existing safe code may be tedious, at least it's
straightforward.

--


More information about the Digitalmars-d-bugs mailing list