3 ms·
Since copy is the rarer of the two (I'd assume most developers are not going to opt-in copy unless they need to, even if it's technically feasible not marking a
by masklinn 12y ago
Since copy is the rarer of the two (I'd assume most developers are not going to opt-in copy unless they need to, even if it's technically feasible not marking a struct as Copy is more future-proof as removing Copy is more likely to break code than adding it) the operator could be `copy`, with everything (including copy-able objects) moving by default, making the language much more uniform.
Of course, there would be no point to Copy then, the language could just lost it and require explicit cloning.
That would certainly be less convenient for basic numeric types.
- dbaupp 12y agoI think copy may be rarer in terms of the number of types, but I suspect it's not rarer in terms of actual use, since shared references (&) and integers are used a lot.
- masklinn 12y agoGood point wrt reference, I always have trouble thinking of them as "real" types to which the rest of the language applies as usual, thanks for the reminder.