[swift-users] Why will RawByte be deprecated in Swift 3?

Marco Masser lists at duckcode.com
Fri Feb 12 04:34:18 CST 2016

There’s a RawByte struct in the Swift 2.2 standard library:

/// A byte-sized thing that isn't designed to interoperate with
/// any other types; it makes a decent parameter to
/// `UnsafeMutablePointer<Memory>` when you just want to do bytewise
/// pointer arithmetic.
@available(*, deprecated, message="it will be removed in Swift 3")
public struct RawByte {

Why is that deprecated? On the current Swift master branch (22c4d7d) it’s still used in the String-related code and there’s also no mention about it being deprecated. Is there a replacement for RawByte? Should I just write my own version when I don’t want Int8 or UInt8 to mean “just a byte”?

Bonus question: Where does this deprecation come from? How can something be deprecated in the public Swift release when it’s not deprecated in the Swift source?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160212/ac2099a7/attachment.html>

More information about the swift-users mailing list