繁体   English   中英

如果我们声明具有所有可选值的结构,那么结构的大小很快是多少?

[英]If we declare structure with all optional values, what is the size of the structure in swift?

例如,我创建了一个具有所有可选值的结构。 那么,结构的大小是多少。 我们如何快速计算结构的大小?

您可以使用此代码。

struct Structure {
    //Some properties here
}

let size = MemoryLayout<Structure>.size

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM