3 ms·
> Modern C++ is as safe as any language you can name It absolutely isn't. C++ will always have the looming spectre of undefined behaviour. I've seen repeated
by MaxBarraclough 7y ago
> Modern C++ is as safe as any language you can name
It absolutely isn't. C++ will always have the looming spectre of undefined behaviour.
I've seen repeated instances of undefined behaviour in respected textbooks: initializing a struct by zeroing it out with memset. It'll probably continue to work fine on MSVC/x64, but presumably the (very knowledgeable!) author didn't realise C++ doesn't guarantee that null will be bitwise zero. Or perhaps they didn't care, and were fine with introducing undefined behaviour into their example code (the kind of sloppiness that demonstrates the value of safe languages).
I suppose you could argue that isn't modern C++, but that would be weak sauce given that we're discussing the safety of the language.