2017-01-01 C言語のsizeofをswiftで書くにはMemoryLayout<T>.size swift タイトルそのままです。 struct Hoge { var a: Int32 var b: Int32 } MemoryLayout<Hoge>.size // 8