Yesterday I heard this in a talk from David Stone
But didn't really pay to much attention to it.
Until today, when I watched Quantum Interpretations of the C++ Object Model, which starts with him saying
Prior to C++20 all C++ programs were undefined. Since C++20 they're probably still undefined, but at least not for lifetime reasons.
What is he talking about?
I know there are things that can't be implemented just by using what's available in the language (I guess std::mutex
definitely can't?); and I know that this is obviously a problem that exists in all (?) programming languages, e.g. Haskell's seq
requires compiler support.
But is anybody really telling me that I can't implement, say std::monostate
?
My point is that there are things that can and things that can't be implemented just by using language tools. What makes std::vector
belong to the latter category?
std::vector
using C++. The implementations provided by the compiler (vendor) have well-defined behavior by the mere fact that it is defined by the Standard. Vendors can use whatever magic they need to make it work including the magic knowledge that their compiler actually does "the right thing" when it sees an implementation ofstd::vector
that follows C++ syntax. – Apollonianstd::vector
, but the standard imposes restrictions on what the resultingstd::vector
do to you. – Aceae