←back to thread

178 points todsacerdoti | 1 comments | | HN request time: 0.215s | source
Show context
choeger ◴[] No.26340875[source]
Why is there no move_back(), I wonder?
replies(2): >>26341048 #>>26341059 #
pornel ◴[] No.26341059[source]
Rust's push is a `move_back`. Curiously, it doesn't have any equivalent of emplace or placement new. It does memcpy on push, and relies on the optimizer to remove it.
replies(1): >>26341702 #
1. __s ◴[] No.26341702[source]
Rust gets away with this because it doesn't have move constructors. Which is a pain if you want self referencing structures, but avoids quite a bit of complexity