Remix.run Logo
spacechild1 5 days 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 4 days ago | parent [-]

>you can express it in C++, just not without additional logic and some overhead :)

How?

spacechild1 4 days ago | parent [-]

E.g. with a boolean member or by setting a bit in the pointer value.