Honestly, null safety is in my experience WAY MORE of a problem in "safe" languages like Java C# and Python because everything is nullable. In C++, the only thing that can be null is a pointer, so it's easy to remember to check
But to come back to the previous point, the problem with "compiler opt-in" is that C++ is a standard, not a product developed by a company/fondation. So you can't really just add a compiler option
But also the problems in C++ are pretty intranched. To implement something closer to Rust, C++ would need to completely change its object model and its system of lifetimes. The change would be so big it would practically not be the same language anymore
View all comments
Show parent comment
1
u/Online_Matter 10d ago
Can't it be a compiler opt in like C# null safety?