<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 18, 2017, at 11:36 AM, Taylor Swift <<a href="mailto:kelvin13ma@gmail.com" class="">kelvin13ma@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class=""><div class="">I'm not sure removing the need for implicit casts is a goal. I did</div><div class="">that with the pointer `init` methods, but now I think that should be</div><div class="">cleaned up to reduce API surface. I think smaller API surface wins in</div><div class="">these cases. Is there a usability issue you're solving?</div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Yes, I can imagine initializing a mutable pointer to some values, and then wanting to use that pointer as a source to initialize more buffers. Having to convert a mutable pointer to an immutable pointer is annoying because a function that takes an immutable pointer obviously shouldn’t care if the pointer could be mutated anyway. It’s like having to rebind a `<span style="font-family: monospace, monospace;" class="">var</span>` variable to a `<span style="font-family: monospace, monospace;" class="">let</span>` constant before passing it as any non-<span style="font-family: monospace, monospace;" class="">inout</span><span class="Apple-converted-space"> </span>argument to a function, since function parameters are immutable. At any rate, this only applies to two out of the seven memorystate operations, so comparably, it’s not a big API expansion at all.</div></div></blockquote><br class=""></div><div>The conversion you’re talking about should be handled by the compiler.</div><div><br class=""></div><div><div>public func get<T>(_ p: UnsafePointer<T>) -> T {</div><div> return p.pointee</div><div>}</div><div><br class=""></div><div>public func foo<T>(p: UnsafeMutablePointer<T>) {</div><div> _ = get(p)</div><div>}</div><div><br class=""></div><div>Or are you thinking of a different use case?</div><div class=""><br class=""></div><div class="">-Andy</div></div></body></html>