fork download
  1. struct T { let a, b, c, d: UInt8 }
  2. let t = T(a: 0, b: 228, c: 14, d: 88)
  3. let anyT = t as Any
  4. print("\(type(of: t)) size:", MemoryLayout.size(ofValue: t))
  5. print("Any \(type(of: anyT)) size:", MemoryLayout.size(ofValue: anyT))
Success #stdin #stdout 0s 7852KB
stdin
Standard input is empty
stdout
T size: 4
Any T size: 32