3 ms·
I think you missed the point. Of course you'd never implement add_one that way, but at some point you'll have a function where you want to pass a unique_ptr as
by Inufu 12y ago
I think you missed the point. Of course you'd never implement add_one that way, but at some point you'll have a function where you want to pass a unique_ptr as an argument, and then your code will happily continue to compile even if you use the pointer after the move.
- danieljh 12y agoAccessing a moved-from object is one of the examples I didn't criticize because it could be an issue and I hope for compilers warning about it. That doesn't make my other claims invalid, though.