Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd an operator overload for clone() #2350
Comments
Centril
added
the
T-lang
label
Feb 24, 2018
This comment has been minimized.
This comment has been minimized.
|
This is better discussed over at internals.rust-lang.org which is more actively looked at. This repository should mainly be used to file full RFCs according to the template as pull requests. The issues filed here are not actively looked at by the teams. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the information. I mirrored the suggestion https://internals.rust-lang.org/t/add-an-operator-overload-for-clone/6823 |
This comment has been minimized.
This comment has been minimized.
|
Great! Closing this one here then =) |
Centril
closed this
Feb 24, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I3ck commentedFeb 24, 2018
Calling multiple functions which take their parameters by reference is quite convenient:
But if functions are defined via move semantics, one has to explicitly
clonenon-Copytypes:Also consider the usage of the
vec!macro, to create aVecof cloned values:The visual noise gets rather bad.
I suggest introducing an operator similar to
*and&which clones the value.Above examples but with
+defined as theclone()-operator (+just being a suggestion, any character would do):