3 ms·
type T struct { X, Y P J *Q Z [42]struct { A R W [100]S } } Please note that P, Q, R and S are arbitrary types, not just a subset of valu
by 4ad 14y ago
type T struct {
X, Y P
J *Q
Z [42]struct {
A R
W [100]S
}
}
Please note that P, Q, R and S are arbitrary types, not just a subset of value types, and an instance of T is contiguous in memory.
- pjmlp 14y agoAh ok, now I understand your point and you're right. I was actually under the impression that any value type could be used in fixed buffers. You can however workaround that by using fixed byte buffers with serialization, but it is not so programmer friendly.