<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 5, 2016, at 2:06 PM, Andrew Trick &lt;<a href="mailto:atrick@apple.com" class="">atrick@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important;">* I don't think I understand `initialize(toContiguous:atIndex:with:)`. Does it return a typed pointer to the whole buffer, or just the one instance it initialized?<span class="Apple-converted-space">&nbsp;</span></span></div></blockquote></div></blockquote></div><div class=""><br class=""></div>Typed pointers are returned only for the memory that was initialized. In this case, a single element:<div class=""><br class=""><div class=""><div class="">&nbsp; /// Initialize the memory location at `index` with `newValue` as if this</div><div class="">&nbsp; /// memory holds at least `index` + 1 contiguous values of type `T`.</div><div class="">&nbsp; ///</div><div class="">&nbsp; /// Returns an `UnsafeMutablePointer&lt;T&gt;` the single intialized</div><div class="">&nbsp; /// in-memory element.</div><div class="">&nbsp; ///</div><div class="">&nbsp; /// - Precondition: The memory at `index` is not initialized.</div><div class="">&nbsp; ///</div><div class="">&nbsp; /// - Precondition: The underlying pointer is properly aligned for</div><div class="">&nbsp; /// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; accessing `T`.</div><div class="">&nbsp; ///</div><div class="">&nbsp; /// - Postcondition: The memory is initialized; the value should eventually</div><div class="">&nbsp; /// &nbsp; be destroyed or moved from to avoid leaks.</div><div class="">&nbsp; @discardableResult</div><div class="">&nbsp; public func initialize&lt;T&gt;(toContiguous _: T.Type, atIndex index: Int,</div><div class="">&nbsp; &nbsp; with value: T)</div><div class="">&nbsp; &nbsp; -&gt; UnsafeMutablePointer&lt;T&gt; {</div><div class="">&nbsp; &nbsp; return (self + strideof(T.self) * index).initialize(T.self, with: value)</div><div class="">&nbsp; }</div></div><div class=""><br class=""></div><div class="">Andy</div></div></body></html>