<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 <<a href="mailto:atrick@apple.com" class="">atrick@apple.com</a>> 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"> </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=""> /// Initialize the memory location at `index` with `newValue` as if this</div><div class=""> /// memory holds at least `index` + 1 contiguous values of type `T`.</div><div class=""> ///</div><div class=""> /// Returns an `UnsafeMutablePointer<T>` the single intialized</div><div class=""> /// in-memory element.</div><div class=""> ///</div><div class=""> /// - Precondition: The memory at `index` is not initialized.</div><div class=""> ///</div><div class=""> /// - Precondition: The underlying pointer is properly aligned for</div><div class=""> /// accessing `T`.</div><div class=""> ///</div><div class=""> /// - Postcondition: The memory is initialized; the value should eventually</div><div class=""> /// be destroyed or moved from to avoid leaks.</div><div class=""> @discardableResult</div><div class=""> public func initialize<T>(toContiguous _: T.Type, atIndex index: Int,</div><div class=""> with value: T)</div><div class=""> -> UnsafeMutablePointer<T> {</div><div class=""> return (self + strideof(T.self) * index).initialize(T.self, with: value)</div><div class=""> }</div></div><div class=""><br class=""></div><div class="">Andy</div></div></body></html>