3 ms·
> You "write C++ every workday" and don't even know that moved-from objects are guaranteed to be valid? I'm getting strong Dunning–Kruger vibes from your reply
by lII1lIlI11ll 1y ago
> You "write C++ every workday" and don't even know that moved-from objects are guaranteed to be valid?
I'm getting strong Dunning–Kruger vibes from your reply. Yes, moved-from objects are in valid but often unspecified state even in STL, not to mention custom code in most C++ projects I had experience with [0][1].
> Any properly configured compiler will catch and warn about those errors.
No true Scotsman compilers...
> Not a real issue if you're using smart pointers. Sure, you can program with no compiler warnings and no smart pointers...
Yeah, the good-old tried-and-true "just always manage your memory correctly and avoid having bugs" way of writing C++ software that have been working out so well.
[0] https://wiki.sei.cmu.edu/confluence/display/cplusplus/EXP63-CPP.+Do+not+rely+on+the+value+of+a+moved-from+object https://wiki.sei.cmu.edu/confluence/display/cplusplus/EXP63-...
[1] https://stackoverflow.com/a/17735913 https://stackoverflow.com/a/17735913