Now I finally see that deepDup/deepCopy/clone is not a (good) solution, because it would be inefficient in a lot of situations. This whole mess makes me wish that D was designed so that all types had value semantics (by convention, since it's probably not possible to enforce by the language).

That would mean:
1) No classes. Just duck-typing based polymorphism à la go language. 2) Dynamic arrays of mutable types would have had to been implemented as copy-on-write types à la Qt containers.

Don't know about the performance implications of COW though.

Reply via email to