Re:The Two Factions of C++
by PittleyDunkin on Monday November 25, 2024 @08:28AM
(#42236105)
That's what the unsafe keyword is for.
Re:The Two Factions of C++
by AlotOfReading on Monday November 25, 2024 @09:27AM
(#42236556)
Sure, but that's not a design philosophy C++ adheres to. Look at the modern C++ guidelines or profiles. The entire point is to rule out large swathes of safe, legitimate, and valid code in an optional and interoperable way.
C++ isn't beholden to Rust's trade-offs either. There's a whole spectrum of possibilities that don't require broken backwards compatibility. Hence: "Why draw the line specifically at lifetime annotations?"
The problem is that the rules enforced by Rust is not restricted to lifetime rules, it's a much much larger superset that includes quite a lot of safe, legitimate and valid code.