2 ms·
Let me add to that list: - Calling std::move on a const object, or an object without a mine constructor, is not a compilation error or even usually a warning,
by quietbritishjim 7y ago
Let me add to that list:
- Calling std::move on a const object, or an object without a mine constructor, is not a compilation error or even usually a warning, and it will just silently perform a copy instead (assuming that the result of std::move is used to initialise another object).
- Oops, I had to add that disclaimer in brackets, because std::move(foo) is valid code that has no effect if not passed to something else. As much as I understand why, chalk that up as another confusing aspect of mine semantics in C++.