Aug 24, 2021
I could rephrase the sentence begining with (As a general rule...), but in reality the compiler's behind-the-scenes optimizations are irrelevent from a behavioral standpoint.
Structs built from value types have value semantics, where mutating a copy of A doesn't affect the orignal A, and that's the behavior the Swift compiler guarantees.
And since that's what the Swift compiler guarantees, we can depend on that behavior when dealing with our mutable objects (structs).