Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
adrianN
3 months ago
|
parent
|
context
|
favorite
| on:
C++ std::move doesn't move anything: A deep dive i...
Is pushing to a moved-from vector even legal? I thought in general the only guarantee you have after a move is that is save to destruct the object.
ben-schaaf
3 months ago
[–]
The state of a moved-from value is valid but unspecified (note, not undefined). IIRC the spec says vector must be `empty()` after a move. So all implementations do the obvious thing and revert back to an empty vector.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: