3 ms·
My sum type example is exactly this (but I didn't use C++ std::variant<> syntax to not confuse the reader). The most common example of a sum type is the "Expre
by maattdd 2y ago
My sum type example is exactly this (but I didn't use C++ std::variant<> syntax to not confuse the reader).
The most common example of a sum type is the "Expression problem" - please read some literature before commenting on a topic.
(Btw, it's called sum type for a reason: summation. The cardinality of the sum type is the sum of the cardinality of its variants)