4 ms·
In fairness to C++, you could derive a class from std::variant and add methods to it that way. It's less awkward with Rust's enums for sure though. And pattern
by tomjakubowski 4y ago
In fairness to C++, you could derive a class from std::variant and add methods to it that way.
It's less awkward with Rust's enums for sure though. And pattern matching as in Rust is far more expressive (and legible) than what std::variant gives you.