4 ms·
In C++ (and C for that matter) you use an enum + union in a struct to implement these virtual structs, then all the criticisms of pointer slicing, and not being
by digikata 11y ago
In C++ (and C for that matter) you use an enum + union in a struct to implement these virtual structs, then all the criticisms of pointer slicing, and not being able to pass by value go away. You do have to manage all that manually though, so
Rust would definitely have the very nice advantage of having language support to do that cleanly.