> On Sep 19, 2016, at 1:24 AM, Martin R via swift-dev <swift-dev@swift.org> > wrote: > > I noticed that both UnsafePointer and UnsafeMutablePointer have the identical > method > > public func withMemoryRebound<T, Result>(to: T.Type, capacity count: Int, > _ body: (UnsafeMutablePointer<T>) throws -> Result) rethrows -> Result > > so that rebinding an immutable pointer gives you a _mutable_ pointer. That is > different from what > > Unsafe[Mutable]Pointer<Pointee> { > func withMemoryRebound<T>(to: T.Type, capacity count: Int, > _ body: (Unsafe[Mutable]Pointer<T>) throws -> ()) rethrows > } > > in > https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md > indicates. Perhaps I am misunderstanding something. Shouldn't rebinding an > UnsafePointer result in an UnsafePointer again? > > Martin
You’re right. There is an inconsistency between the proposal and Swift 3 implementation. I’ve been thinking about whether it makes more sense to correct this sooner or later. I responded in more detail on swift-evolution. -Andy _______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev