On Jun 1, 2025, at 10:32 AM, Thomas Krogh Lohse via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I’d love to hear your thoughts:
* Do you see value in defining a "safe-by-default" C++ subset with opt-in unsafe features?
“Safe-by-default” will not work. C++ always tries to be backwards compatible and old (currently correct) code might not compile with your feature on. Currently, there are several proposals for so-called profiles (
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3589r0.pdf can give a good start into this topic with additional references at the bottom of this proposal).
Your work should nicely fit into these profiles or add a new profile. Some of it is quite closely related, though profiles don’t discuss a borrower checker, yet. “Safe-by-default” could, however, be a compiler flag that turns on certain profiles by default. This might be the safest you can get without running against some of the core C++ philosophies.
(The goto discussion could also be solved by profiles.)