I am not sure what you mean, you can definitely have e.g. an
std::variant<int, std::string, bool>
Which is a sum of those three types. std::variant<int, std::string, bool>
Which is a sum of those three types.[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html