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

Sometimes there is no valid state for a `std::move`d object, e.g. a `std::unique_ptr`.



Wouldn't just be nullptr?


The very concept of a nullable pointer is problematic, because it means that every dereference operation is potentially unsafe.

The only satisfactory solution is to enforce, using the type system, the rule that moved objects can't be reused. Unfortunately, C++'s type system can't express this.




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

Search: