Re: [swift-dev] Rebinding UnsafePointer makes it mutable

2016-09-19 Thread Andrew Trick via swift-dev
> On Sep 19, 2016, at 1:24 AM, Martin R via swift-dev > wrote: > > I noticed that both UnsafePointer and UnsafeMutablePointer have the identical > method > >public func withMemoryRebound(to: T.Type, capacity count: Int, > _ body: (UnsafeMutablePointer) throws -> Result) rethrows -> Resul

[swift-dev] Rebinding UnsafePointer makes it mutable

2016-09-19 Thread Martin R via swift-dev
I noticed that both UnsafePointer and UnsafeMutablePointer have the identical method public func withMemoryRebound(to: T.Type, capacity count: Int, _ body: (UnsafeMutablePointer) throws -> Result) rethrows -> Result so that rebinding an immutable pointer gives you a _mutable_ pointer. That