Your example is specific to C++ only. In Rust it is not just an optimization,
it's about ownership. Example from Rust:
fn f1(vec: Vec<i32>) {}
fn f2() {
let mut vec = vec![1];
f1(vec);
vec.push(2); // This will not compile (borrow of moved value), because f1
took ownership of vec
}
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/QYDSI2ZBJ6RTJCZYVGMKL6VDMGIJOSZ6/
Code of Conduct: http://python.org/psf/codeofconduct/