Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftmemory layout and alignmentSingle-choice MCQ

In `struct Pair { var a: Bool; var b: Bool; var c: Bool }`, the type holds 3 booleans. Why is `MemoryLayout<Pair>.size == 3` rather than packed into a single byte using bit fields?

struct Pair { var a: Bool var b: Bool var c: Bool }