mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
tutorial: Mention by-value argument passing style.
This commit is contained in:
parent
8319b5a252
commit
eba891e989
@ -104,6 +104,9 @@ Another style is by-move, which will cause the argument to become
|
||||
de-initialized on the caller side, and give ownership of it to the
|
||||
called function. This is written `-`.
|
||||
|
||||
Sometimes you need to pass a structural type by value, such as when
|
||||
interfacing with external native functions. This is written `++`.
|
||||
|
||||
Finally, the default passing styles (by-value for non-structural
|
||||
types, by-reference for structural ones) are written `+` for by-value
|
||||
and `&&` for by(-immutable)-reference. It is sometimes necessary to
|
||||
|
Loading…
Reference in New Issue
Block a user