News for hackers. Stuff that matters.
Re:C++ and zombies: a moving question by meetingcpp on Friday October 31, 2014 @04:01PM (#8540811)
Well, of course accessing the value of fh after foo would be fatal. But how would you then sort a container of moveable-only objects?

An object should be accessible for reassigning a value after its move, as its often needed for algorithms, thats exactly why the C++ Standard mandates this. Move does really only make sense if the class holds a moveable allocation, such as a container, array etc., which makes copying expensive.

Re:C++ and zombies: a moving question by dbaupp on Friday October 31, 2014 @08:39PM (#8541798)
> An object should be accessible for reassigning a value after its move, as its often needed for algorithms, thats exactly why the C++ Standard mandates this.

The same is true in Rust. A moved-from value can be reassigned, but cannot be used (compile enforced) until it is reassigned. :)