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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QYDSI2ZBJ6RTJCZYVGMKL6VDMGIJOSZ6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to