|
|
|
|
|
by shaklee3
2457 days ago
|
|
I know how these things work in Rust, and I'm still failing to see your point. It's not at all as complicated as what you are saying given that you can find many blog articles that explain it succinctly in a couple paragraphs. It's not at all helpful to say that there's something so complicated on these other languages that you can't possibly get the idea across without using them. |
|
You can translate all the code above to C++ to use std::visit + std::variant instead. I personally find that C++ is unusable for programming like this, and almost never use std::variant in C++ as a consequence, while I use ADTs in Rust all the time.