by sapiogram · 1y ago · 0 comments
While this may work as a rough heuristic, it's not true in theory nor in practice. First example that comes to mind: Rust has proper sum types (Called enums), which are used everywhere, and C++ doesn't have anything like it.
In C++ everything is just more awkward since everything is bolted on as an afterthought in the stdlib but then lacking language syntax sugar to make its usage convenient.
E.g. the (somewhat weird looking) equivalent to Rust's match is called 'visit' in C++:
I'm sure you could technically emulate all this in C++ is you keep throwing template metaprogramming at it, but at that point anything is a C++ subset and the statement loses all pratical meaning.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p26...
By the way, ever noticed that after C89, neither Ritchie nor Dennis ever had anything else to do with how WG14, or the compiler industry vendors, decided to take C onwards?
The original Plan 9 C compiler isn't even standards compliant.