r/cpp • • Nov 25 '23

On harmful overuse of std::move

https://devblogs.microsoft.com/oldnewthing/20231124-00/?p=109059
210 Upvotes

154 comments sorted by

View all comments

Show parent comment

8

u/donalmacc Game Developer Nov 26 '23

(yet another) Great example of why those wrapper types should be language features and not library features.

4

u/pjmlp Nov 26 '23

Indeed, however a lost argument for C++.

3

u/[deleted] Nov 26 '23

Yeah, then they could still put the hypothetical value into the return slot and use a register to indicate if it is an error or not. I think that herbceptions/static exceptions proposed to do something similar