<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 2016-02-13, at 05:38, Dmitri Gribenko &lt;<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Fri, Feb 12, 2016 at 2:34 AM, Marco Masser via swift-users<br class="">&lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class=""><blockquote type="cite" class="">There’s a RawByte struct in the Swift 2.2 standard library:<br class=""><br class="">/// A byte-sized thing that isn't designed to interoperate with<br class="">/// any other types; it makes a decent parameter to<br class="">/// `UnsafeMutablePointer&lt;Memory&gt;` when you just want to do bytewise<br class="">/// pointer arithmetic.<br class="">@available(*, deprecated, message="it will be removed in Swift 3")<br class="">public struct RawByte {<br class="">}<br class=""><br class="">Why is that deprecated? On the current Swift master branch (22c4d7d) it’s<br class="">still used in the String-related code and there’s also no mention about it<br class="">being deprecated. Is there a replacement for RawByte? Should I just write my<br class="">own version when I don’t want Int8 or UInt8 to mean “just a byte”?<br class=""></blockquote><br class="">Using UInt8 or Int8 is recommended.<br class=""></div></div></blockquote><div><br class=""></div><div>OK, I settled on&nbsp;<span style="color: rgb(187, 44, 162); font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">typealias</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class=""> Byte = </span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">UInt8</span>&nbsp;within my&nbsp;<span style="font-family: Menlo; font-size: 11px;" class="">Socket</span>&nbsp;type, so it’s <span style="font-family: Menlo; font-size: 11px;" class="">Socket.Byte</span>&nbsp;now.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class="">Bonus question: Where does this deprecation come from? How can something be<br class="">deprecated in the public Swift release when it’s not deprecated in the Swift<br class="">source?<br class=""></blockquote><br class="">It comes from a preview implementation of SE-0006<br class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md</a></div></div></blockquote><br class=""></div><div>Ah, missed that one in the diffs. Thanks for pointing it out.</div><div><br class=""></div><div>Cheers,</div><div><br class=""></div><div>Marco</div></body></html>