top | item 47076850 (no title) maleldil | 10 days ago These are not proper sum types, since you're limited to one variant per type. discuss order hn newest sebtron|10 days ago 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. maleldil|10 days ago See the first IpAddr example here[1], where you have separate variants, both with string representations. You can't do this with std::variant. You have to use separate types.[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html load replies (1)
sebtron|10 days ago 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. maleldil|10 days ago See the first IpAddr example here[1], where you have separate variants, both with string representations. You can't do this with std::variant. You have to use separate types.[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html load replies (1)
maleldil|10 days ago See the first IpAddr example here[1], where you have separate variants, both with string representations. You can't do this with std::variant. You have to use separate types.[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html load replies (1)
sebtron|10 days ago
maleldil|10 days ago
[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html