C++ is performance first at any price. Hence UB.
Rust is also after performance, but will specify implementation details where C++ will defer to compiler writers.
C++ is performance first at any price. Hence UB.
Rust is also after performance, but will specify implementation details where C++ will defer to compiler writers.
I don't think this is entirely correct, C++ in some cases famously preferred ABI compatibility over maximum performance.
Nowadays MSVC tries to maintain ABI compatibility too, so we should stop seeing a proliferation of those msvcrXXX dlls.
Haiku uses C++ for its OS ABI so it relies quite heavily on the fact that ABI compatibility stays very consistent across compiler versions for example.
The creator of C++ would love for there to be safer abstractions, but has the baggage of the past to carry.
std::optional is relatively new, and supports dereferencing, which when it’s empty is UB instead of an abort.
There are no plans to add checks to any existing APIs, because “it didn’t have a branch before” is also considered a compatibility issue.
C++11 is almost as old now as C++98 was when C++11 came out. It's evolved plenty.