Why does © in the below code need to be based on a var, why can't it be a let?
var mutableCopy = instanceOfA
let data = Data(bytes: &mutableCopy, count: MemoryLayout.size(ofValue: instanceOfA))
let immutableCopy = instanceOfA
// Cannot pass immutable value as inout
let data = Data(bytes: &immutableCopy, count: MemoryLayout.size(ofValue: instanceOfA))
Edit: To avoid confusion: I'm totally aware of how inout works. My problem is that the Data.init(bytes:,count:) doesn't take an inout but just a plain UnsafeRawPointer and since it's not mutable, why does it require a var rather than a let?