Understanding Copy-On-Write(COW) in Swift by Building It From Scratch

When I first learned that Swift structs are value types, I assumed every copy created completely new memory.