Add description of by-move mode.

This commit is contained in:
Graydon Hoare 2012-04-11 10:20:52 -07:00
parent fd26743bed
commit 9e726b0461

View File

@ -1476,6 +1476,13 @@ fn make_person(+name: str, +address: str) -> person {
}
~~~~
Finally there is by-move style, written `-`. This indicates that the
function will take ownership of the argument, like with by-copy style,
but a copy must not be made. The caller is (statically) obliged to not
use the argument after the call; it is de-initialized as part of the
call. This is used to support ownership-passing in the presence of
non-copyable types.
# Generics
## Generic functions