<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=""><div class="">A proposal draft can be found here:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/Jnosh/swift-evolution/blob/copying-to-unsafe-mutable-pointer-with-unsafe-pointer-source/proposals/0000-copying-to-unsafe-mutable-pointer-with-unsafe-pointer-source.md" class="">https://github.com/Jnosh/swift-evolution/blob/copying-to-unsafe-mutable-pointer-with-unsafe-pointer-source/proposals/0000-copying-to-unsafe-mutable-pointer-with-unsafe-pointer-source.md</a></div><div class=""><br class=""></div><div class=""><div class="">- Janosch</div></div><br class=""><div><blockquote type="cite" class=""><div class="">On 03 Feb 2016, at 21:52, Félix Cloutier &lt;<a href="mailto:felixcca@yahoo.ca" class="">felixcca@yahoo.ca</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Looks reasonable to me.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Félix</span>
</div>

<br class=""><div style="" class=""><blockquote type="cite" class=""><div class="">Le 2 févr. 2016 à 19:50:50, Guillaume Lessard via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On 2 févr. 2016, at 16:06, Janosch Hildebrand via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">func assignBackwardFrom(source: UnsafeMutablePointer&lt;Pointee&gt;, count: Int)<br class="">func assignFrom(source: UnsafeMutablePointer&lt;Pointee&gt;, count: Int)<br class="">func initializeFrom(source: UnsafeMutablePointer&lt;Pointee&gt;, count: Int)<br class=""><br class="">Basically my proposal boils down to adding overloads for these methods to `UnsafeMutablePointer` that take `UnsafePointer` source arguments instead.<br class=""></blockquote><br class="">I agree with these; I have run into this situation as well.<br class=""><br class=""><blockquote type="cite" class=""><br class="">Related:<br class="">I also have a few related items that might make sense to discuss in tandem while we're talking about `UnsafePointer` and friends.<br class=""><br class="">* func distanceTo(x: Unsafe(Mutable)Pointer&lt;Memory&gt;) -&gt; Int<br class="">This is the only other method on `UnsafePointer` and `UnsafeMutablePointer` for which similar overloads might make sense. However, I cannot really see enough of a use case to justify adding overloads here. Also the current methods match protocol requirements whereas the overloads would not.<br class=""></blockquote><br class="">I don’t think this would makes sense. This method exists to support indexing within a single block of memory; overloading across types might encourage recklessness.<br class=""><br class="">This being said, I’ve come to think the indexing operations should only exist on the Buffer wrappers to the UnsafePointer family.<br class=""><br class="">Guillaume Lessard<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><div class=""><div class=""><br class=""></div></div></body></html>