3 ms·
> This means C++ is riddled with types that have unrelated "I'm empty" state Again, these cases are still rare. Most classes either don't require user-defined
by spacechild1 1y ago
> This means C++ is riddled with types that have unrelated "I'm empty" state
Again, these cases are still rare. Most classes either don't require user-defined move operations, or they have some notion of emptiness or default state.
> And if we don't want to allow None? Too bad, you can't express that in C++
That's actually a good example! Nitpick: you can express it in C++, just not without additional logic and some overhead :)
- 7jjjjjjj 1y ago>you can express it in C++, just not without additional logic and some overhead :) How?
- spacechild1 1y agoE.g. with a boolean member or by setting a bit in the pointer value.