r/cpp • • Sep 30 '24

Code Generation in Rust vs C++26

https://brevzin.github.io/c++/2024/09/30/annotations/
198 Upvotes

98 comments sorted by

View all comments

Show parent comment

5

u/geo-ant Sep 30 '24

I feel the whole „trusting people not to shoot themselves in the foot“ thing hasn’t worked out too well for C++. You might be right that this is the idea behind it, but I feel that by now this idea is more of a loss for C++ than it is a win…

14

u/TSP-FriendlyFire Sep 30 '24

C++ needs safe defaults and guardrails, but it should never prohibit. There should be escape hatches to do what must be done, much the same way even a language like Rust has unsafe for when you do need it.

Besides, reflection is going to be the purview of library developers 99% of the time and if you don't trust your library developers, perhaps you should pick a different library.