[swift-users] @_transparent allowing a data member inside an enum inside MemoryLayout.swift
spestov at apple.com
Wed Aug 2 23:43:39 CDT 2017
> On Aug 2, 2017, at 4:01 PM, Shyamal Chandra via swift-users <swift-users at swift.org> wrote:
> After reading the Ray Wenderlich website tutorial  about Unsafe Swift, I was checking out this file  inside swift/stdlib/public/core titled MemoryLayout.swift. However, I was confused about the @_transparent before the each data member inside the enum. Why is this enum with the data members allowed by the Swift 3 language? What does @_transparent allow you to do that you might not otherwise? Could someone explain because the documentation is still unclear ?
@_transparent is only meant for use by the standard library and overlays. However, I’d be happy to answer any questions you may have about this attribute or its implementation, however you’ll need to be more specific. Which parts of TransparentAttr.rst are unclear? Note that the document is somewhat outdated but still largely accurate (some of the individual problems listed at the end have since been fixed, but the overall issues remain).
> Shyamal Chandra
> shyamalc at gmail.com <mailto:shyamalc at gmail.com>
>  https://www.raywenderlich.com/148569/unsafe-swift <https://www.raywenderlich.com/148569/unsafe-swift>
>  https://github.com/apple/swift/blob/master/docs/TransparentAttr.rst <https://github.com/apple/swift/blob/master/docs/TransparentAttr.rst>
>  https://github.com/apple/swift/blob/master/stdlib/public/core/MemoryLayout.swift <https://github.com/apple/swift/blob/master/stdlib/public/core/MemoryLayout.swift>
> swift-users mailing list
> swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users