3 ms·
The author is wrong in their description. Some value types in Swift (like the standard library collection types like Array<T>) are value types with copy-on-writ
by monocularvision 7y ago
The author is wrong in their description. Some value types in Swift (like the standard library collection types like Array<T>) are value types with copy-on-write behavior. Until modified, copies of the Array are not made.
That copy-on-write functionality must be purposely implemented in the type and is not something provided automatically in Swift.
- skohan 7y agoThanks for the feedback, I was conflating copying with copy-on-write. I have made a correction in the article.