4 ms·
Not until we get reflection. And reflection efforts seem to be at an impasse, so I don’t imagine we will see it for a few years at least. I will add, though, t
by i-use-nixos-btw 3y ago
Not until we get reflection. And reflection efforts seem to be at an impasse, so I don’t imagine we will see it for a few years at least.
I will add, though, that I’ve found copilot to be very handy when it comes to generating formatting. Last week I used it while writing fmt::formatter specialisations for a library with 50 structs, some having over 20 members. Writing all of them took about 10 minutes. I dare say the same would hold for operator<< overloads.
- ComputerGuru 3y agoRust does not use reflection for this. Reflection support in rust isn’t actually much better than in C++.
- i-use-nixos-btw 3y agoI’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).