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++
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
Posted Mar 14, 2024 23:26 UTC (Thu)
by khim (subscriber, #9252)
[Link]
C++ couldn't pull that trick. At least not just yet. You need to first stop using C++20 added proper modules, but their adoption is still not something to write home about.
> Or you copy yet another trick from the Rust toolbox.
Herb Sutter on increasing safety in C++
#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”.
