Shallow copy object when type is know

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 21 01:45:46 PDT 2016


On Wednesday, 20 April 2016 at 19:58:15 UTC, Tofu Ninja wrote:
> How does D not have shallow copy? Seems like a very basic 
> functionality...

You could implement a `dup()` method. `dup` is already used for 
shallow copying of arrays, why not reuse it for classes (as a 
convention)?


More information about the Digitalmars-d-learn mailing list