by DLoupe · 1y ago · 0 comments
That's one of my biggest issues with C++ today. Objects that can be moved must support a "my value was moved out" state. So every access to the object usually starts with "if (have-a-value())". It also means that the destructor is called for an object that won't be used anymore.
MSVC and the Clang static analyzer have a analysis checks for this too. Not sure about GCC.
It's worth remembering though that values can be reinitialized in C++, after move.