4 ms·
Every time, every time I wrestle with C++ compiler on the move constructors/semantics, I open this post[1] by Herb Sutter saying that C++ moves are simple and m
by kvark 4y ago
Every time, every time I wrestle with C++ compiler on the move constructors/semantics, I open this post[1] by Herb Sutter saying that C++ moves are simple and misunderstood. It's humiliating to read. Finally, somebody dissected a section by section and explained in a reasonable language that there is nothing simple about C++ moves.
TL:DR of the article: C++ moves are bad because they effectively force nullability on everything, and they provide no guarantees about the state of the objects.
[1] https://herbsutter.com/2020/02/17/move-simply/ https://herbsutter.com/2020/02/17/move-simply/
- thecodedmessage 4y agoThanks so much! That article was the original (anti-)inspiration for this post. It is so condescending: "Moves are so simple if you pretend you don't understand what they're for and why they're preferable to copies, and also ignore the name."