When do I need keyword
move? I know that when I pass primitive type as function argument it’s being copied and still exist in current scope, when I pass complex types (struct or vector) they’re being moved. That being said, I can only imagine using
moveto explicitly move primitive value to another scope (though is there a reason to do so?).
How does dereferencing work? I remember in one of my experiments I successfully recreated object from mutable reference in another scope by using deref. Is it actually copying original value? Is pricey in terms of gas? Should I avoid unnecessary dereferencing?
Follow up on question 2: if I can copy though deref, are there cases where explicit
copyis the only possible way of achieving smth?