Preferences

Yes, but if you have a large value type it will be on the stack unless you manually box it. Passing by value can get quite expensive quite fast, especially if the value keeps being passed up and down the call chain.

Is this really true? What do you mean by value types? The types that implement copy or any struct types? Because I think struct types only get moved
Move and copy are both the same operation under the hood, move just means that the old version is marked invalid and not available for use anymore.

For large structs (or enums), move and copy both compile into memcpy. If the structures are large, this can take a lot of time.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal