top | item 45155281

(no title)

DLoupe | 5 months ago

By adding syntax and semantics for destructible moves, meaning the moved object is removed from its scope (without calling its destructor.)

discuss

order

motorest|5 months ago

I've worked with C++ for a number of years, with a few codebases that were >1M LoC. Never did I stumbled upon a situation where an object was moved and an existing symbol became a problem. I wonder what you are doing to get yourself in that situation.

DLoupe|5 months ago

> I wonder what you are doing to get yourself in that situation.

The problem with the current move semantics is that, compared to e.g. Rust: 1) the compiler generates unnecessary code and 2) instead of just implementing class T you must implement a kind of optional<T>.

Which means, that after all those years of using smart pointers I find myself ditching them in favor of plain pointers like we did in the 90's.