▲ | DLoupe 4 days 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. | ||||||||
▲ | catlifeonmars 4 days ago | parent | next [-] | |||||||
When you say you must, do you mean that it’s best practice, that or that this is UB or similar? | ||||||||
| ||||||||
▲ | motorest 4 days ago | parent | prev [-] | |||||||
> 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>. I don't know what you mean by "compiler generates unnecessary code" or why you see that as a problem. I also have no idea what you mean by "a kind of optional". The only requirement on moved-from objects is that they must be left in a valid state. Why do you see that as a problem? | ||||||||
|