3 ms·
Sometimes there is no valid state for a `std::move`d object, e.g. a `std::unique_ptr`.
by catnaroek 11y ago
Sometimes there is no valid state for a `std::move`d object, e.g. a `std::unique_ptr`.
- ant6n 11y agoWouldn't just be nullptr?
- catnaroek 11y agoThe 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.