←back to thread

128 points RGBCube | 1 comments | | HN request time: 0s | source
Show context
hyperbrainer ◴[] No.44497751[source]
> we cannot just require all generic parameters to be Clone, as we cannot assume they are used in such a way that requires them to be cloned.

I don't understand what "used in such a way requires them to be cloned" means. Why would you require that?

replies(3): >>44497760 #>>44497770 #>>44497789 #
1. rocqua ◴[] No.44497760[source]
A type might have a generic parameter T, but e.g. use it as a phantom marker.

Then even if T isn't cloneable, the type might still admit a perfectly fine implementation of clone.