Hacker News new | past | comments | ask | show | jobs | submit login

Both are similar in the sense that `foo` owns `value`, yes.

Or at least that's the idea. In C++, it's up to the author of T to implement such semantics (through its move constructor) correctly for non-trivial types.




I wouldn't call this owning, a better description is that that foo is a sink for the value.


Rust would call that owning, though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: