Copying is supported for String and all types of collections - Array , Dictionary and Set .
In addition, the compiler can optimize any access to the structure and effectively provide you with copy-on-write semantics, but this is not guaranteed.
source share