C++ still doesn't have a sane modern pattern for tagged unions. If you want to define a type to represent, say, a simple parse tree, then Rust makes that easy and obvious, whereas C++ offers you a hundred options, all of which suck.
Isn't the obvious choice std::variant<>?
It is kind of annoying to use, but at least there is an obvious default choice.
Isn't the obvious choice std::variant<>?
It is kind of annoying to use, but at least there is an obvious default choice.