[swift-users] C compatible structs

KS Sreeram ks at claylabs.com
Wed Aug 3 01:08:29 CDT 2016


> On 03-Aug-2016, at 10:02 AM, Chris Lattner <clattner at apple.com> wrote:
> 
> Right.  In the future we will probably add the ability to put explicit alignment/layout information on structure fields. This would be useful for this, as well as other cases where you’re trying to match a specific layout used in an on-disk file format or memory mapped device.

That was exactly my use case. I’m storing raw structs in LMDB.

> That said, this doesn’t fit in the scope for Swift 4 stage 1.

Though a bit cumbersome, Dmitri’s solution is good enough for now. It’ll be great to have this directly supported in Swift.

Thanks
KS Sreeram



More information about the swift-users mailing list