This isn't true. Copy-on-write semantics are implemented only for arrays, dictionaries, and strings. Swift value-types are copied immediately.
https://docs.swift.org/swift-book/documentation/the-swift-pr...
The documentation has oversimplified a bunch of the mental model and it causes incorrect understanding.
Swift’s documentation is quite bad TBH. The biggest thing that still needs to be improved a lot.
The documentation has oversimplified a bunch of the mental model and it causes incorrect understanding.
Swift’s documentation is quite bad TBH. The biggest thing that still needs to be improved a lot.