4 ms·
I would also argue that even after an object has been moved (out of?), that object should still be a valid object. So that even if somebody makes a call to it,
by machinecoffee 7y ago
I would also argue that even after an object has been moved (out of?), that object should still be a valid object. So that even if somebody makes a call to it, it shouldn't 'blow up' , but do add asserts to indicate you're now talking to an object that is no longer initialized to a useful state. E.g. if moving a class that wraps a file descriptor, then calling write() would do nothing, but a debug build could also assert() that the file descriptor is not valid.
That way you get runtime stability if you screw up, but no weird side-effects.