Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
eterevsky
10 days ago
|
parent
|
context
|
favorite
| on:
Move semantics in Rust, C++, and Hylo
In C++ you can force the move of the parameter by wrapping it with std::move() this should take care of unnecessarily cloning the argument in the example.
masklinn
10 days ago
[–]
std::move does not force anything , it is a cast to an rvalue reference (a movable-from).
Whether the object is moved depends on whether the target / destination / sink cares.
reply
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: