3 ms·
What if I want to pass a pointer into the function (maybe I want to mutate the object), but I want that pointer to be non-nil? You make it seem like value type
by maleldil 5y ago
What if I want to pass a pointer into the function (maybe I want to mutate the object), but I want that pointer to be non-nil?
You make it seem like value types solve this problem, but they don't. C also has the same thing you're talking about, but it still has nullability problems.
I think other comments are not even asking for anything complex. Something akin to C++'s references (which cannot be null) would already be a step forward.