Re:Formatting Text in C++: The Old and the New Ways
by ComputerGuru on Sunday September 17, 2023 @01:43AM
(#37541880)
Rust does not use reflection for this. Reflection support in rust isn’t actually much better than in C++.
[ Parent
| on HN ]
Re:Formatting Text in C++: The Old and the New Ways
by i-use-nixos-btw on Sunday September 17, 2023 @05:08PM
(#37549325)
I’m not a rust dev, but looking into how the Debug trait works, it’s basically what we’d need compile time reflection to get in C++.
It generates code that uses the class name and class members. In C++ we have no way of doing that (without hacky macro stuff).