[swift-evolution] [Pitch] Don't require & for UnsafeRawPointer

Guillaume Lessard glessard at tffenterprises.com
Wed May 17 16:53:57 CDT 2017


> On May 17, 2017, at 15:28, Jordan Rose <jordan_rose at apple.com> wrote:
> 
> This can come up even without &. It is illegal to use UnsafeMutablePointer.init(mutating:) on something that was not a mutable pointer to begin with, and the program is not guaranteed to do anything sensible if you break that rule.

“Illegal" or no, if it can be done it will de done. I just think it would be more sensible to *not* allow taking pointers to non-mutable variables at all.

Cheers,
Guillaume



More information about the swift-evolution mailing list