> On Mar 22, 2016, at 2:35 PM, Chris Lattner <[email protected]> wrote:
>
> The review of "Adding initializers to Int and UInt to convert from
> UnsafePointer and UnsafeMutablePointer" begins now and runs through March
> 25th. The proposal is available here:
>
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0016-initializers-for-converting-unsafe-pointers-to-ints.md
>
> <https://github.com/apple/swift-evolution/blob/master/proposals/0016-initializers-for-converting-unsafe-pointers-to-ints.md>
+1
I agree with all of the feedback so far, and I think bitPattern is a good label
name.
The dangerous case is the UInt to UnsafePointer conversion that already exists.
If we allow that, then adding symmetry is only natural.
I’ll add that I don’t particularly like the practice of using unsafeBitcast on
pointer values. It does not sufficiently inform the compiler that the type
system is being circumvented because no information is carried through to the
point of access. UInt to UnsafePointer has the same problem, but I like the
fact that a separate, explicit API is used when pointers are involved.
-Andy
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution