4 ms·
You are correct; my original definition that only went till `copy` was encountered is only the most common case of your more general definition. The principles
by Blikkentrekker 5y ago
You are correct; my original definition that only went till `copy` was encountered is only the most common case of your more general definition.
The principles are still quite similar and it still seems easier to implement to me than shallow copies as a generic trait.
I don't know how I would fit shallow copies into Rust's trait system.
- kzrdude 5y agoClone seems to be the shallowest kind copy permitted by the type and ownership system.
- Blikkentrekker 5y agoWhich is why I find deep copies to be easier to implement than shallow. It is of course possible to express a shallower copy, but not in the same generic way as a universal trait, that I know of, in any case.