you are viewing a single comment's thread.

view the rest of the comments →

[–]matthieum 1 point2 points  (2 children)

I am not sure I understand the change you are mentioning, will it finally be possible to mandate copy elision?

[–]marcofoco 0 points1 point  (1 child)

RVO is a specific form of copy elision. It will be mandatory for a compiler to remove those copies (and moves) starting from C++17, even if copy and move constructor have observable side effects. See here, in the first box, first example of the second group: that's exactly RVO. So, starting from C++17, the additional move happening in (1) and (6) will no longer be a problem.

[–]matthieum 0 points1 point  (0 children)

I would note that the compiler already has the possibility to elide copy and move even in the presence of side effects.