4 ms·
C++ has had sum types for years, so I'm not sure why that was mentioned. If you aren't familiar/experienced with the language, then the comparison is not fair o
by shaklee3 7y ago
C++ has had sum types for years, so I'm not sure why that was mentioned. If you aren't familiar/experienced with the language, then the comparison is not fair overall.
- jcora 7y agoYeah it's had everything for years. I'd rather shoot myself than use those features outside of a modern language where they aren't just bolted on along a billion other things.
- ncmncm 7y agoIt is correct to note that C++ lacks some core language features that many newer languages have, tailored to more convenient and, often, safer use of slippery sum types. Sum types are a step away from lexical typing, and without that support add risk that strong typing was invented to contain. There is an active project to have a powerful pattern-matching primitive ready in time to adopt into C++23. In the meantime, C++17 supports "structured bindings" that are often helpful.