[swift-users] @_transparent allowing a data member inside an enum inside MemoryLayout.swift

Shyamal Chandra shyamalc at gmail.com
Wed Aug 2 18:00:55 CDT 2017


Hi,

After reading the Ray Wenderlich website tutorial [1] about Unsafe Swift, I
was checking out this file [3] 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 [2]?

Thanks!

Best,

Shyamal Chandra
shyamalc at gmail.com

Sources:

[1] https://www.raywenderlich.com/148569/unsafe-swift
[2] https://github.com/apple/swift/blob/master/docs/TransparentAttr.rst
[3]
https://github.com/apple/swift/blob/master/stdlib/public/core/MemoryLayout.swift
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170802/400e01de/attachment.html>


More information about the swift-users mailing list