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

I think he just means the move constructor is not guaranteed to move anything. It is only expected to.



The rule of three/five is probably the most tedious thing to deal with in modern C++. Assuming all your member variables are C++ types it's not TERRIBLE, you should be able to handle everything in the initialization list (using std::move for the move constructor) - but it's still easy to forget to initialize a member.

This is one area where Rust really makes life much easier.


Use rule of zero as far as possible. All the tedious stuff that comes with rule of five should be isolated to very few components in your code.




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

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

Search: