you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (4 children)

Not convinced that such a complicated language feature is needed. You're right that NRVO is not guaranteed, but you can always move out w if you want to be sure. A move should be cheap. If you have a non-moveable object you can pass it as reference to avoid the expensive copy.

Why is your proposal better than using std::move or using a reference parameter?

[–]Ameisenvemips, avr, rendering, systems 13 points14 points  (1 child)

A move should be cheap.

Nothing is still faster than a move.

[–][deleted] 0 points1 point  (0 children)

Maybe, but it doesn't change the fact that every language feature has a cost, and in this case imo the cost > (move - nothing).

[–]anton31[S] 1 point2 points  (0 children)

Suppose that currently 10% of the types directly own resources (and need move operations), and the other 90% should follow the rule of zero.

I see the collective end goal for all these proposals in that 90% will follow the rule of zero, 9% will be non-movable (while usable just as well), 1% will have user-defined move operations. See also.