|
|
Subscribe / Log in / New account

Herb Sutter on increasing safety in C++

Herb Sutter on increasing safety in C++

Posted Mar 13, 2024 22:02 UTC (Wed) by Wol (subscriber, #4433)
In reply to: Herb Sutter on increasing safety in C++ by marcH
Parent article: Herb Sutter on increasing safety in C++

> Granted, "Safer C++" needs to break a lot more legacy code: it's quantitatively different but not qualitatively different.

Or you copy yet another trick from the Rust toolbox. The *default* is "safe C/C++", but you flick the C99/C++25/whatever switch, and all your old, dodgy code will still compile, run and fall over just as before.

Cheers,
Wol


to post comments

Herb Sutter on increasing safety in C++

Posted Mar 14, 2024 23:26 UTC (Thu) by khim (subscriber, #9252) [Link]

> Or you copy yet another trick from the Rust toolbox.

C++ couldn't pull that trick. At least not just yet. You need to first stop using #include as poor man replacement for modules first, otherwise it's pretty much impossible to say which code is supposed to be written in an “old version” and which should be written in a “new version”.

C++20 added proper modules, but their adoption is still not something to write home about.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds