[swift-users] Mapping C semantics to Swift
kenb at iotone.io
Thu May 19 12:00:30 CDT 2016
I would like to know if a struct in Swift has any guarantee of
contiguity, like a struct in C. I am attempting to port a C program
that makes many assumptions about the underlying semantics of C structs,
and does things like overlaying an array over the struct using a cast,
and then performs and cryptographic hashing of the entire struct by
treating it as an array.
1. I a Swift struct contiguous?
2. If 1 above is true, can I somehow cast an array over the struct?
Principal Software Engineer
Email: kenb at iotone.io
More information about the swift-users