3 ms·
I don't see the author's point in section "Move semantics". The second let statements for `total` is just shadowing the first. Nothing fancy going on here.
by quelltext 8y ago
I don't see the author's point in section "Move semantics". The second let statements for `total` is just shadowing the first. Nothing fancy going on here.
- quelltext 8y agoI guess move semantics are a thing here, i.e. the function call "consumes" the variable. My suggestion to the author would be to show an example that better illustrates this, e.g. a case that causes a compiler error.
- quelltext 8y agoHmm no, that type there has Copy implemented, so I don't get the author's point after all.