3 ms·
The problem with adding a non_null_unique_ptr<T> to C++ is that moving needs to leave behind a valid value.
by CodesInChaos 3y ago
The problem with adding a non_null_unique_ptr<T> to C++ is that moving needs to leave behind a valid value.
- gpderetta 3y agoYou are right, but you could make it not movable (and add destructive mode hooks for optional and containers). It is still possible to return non-movable, non-copyable types from functions. But I guess ergonomics would not be good.