This is due to a late change to the move-semantics rules for C ++ 11. The original move proposal did not automatically move when the arguments to the value-value function appeared in the return statement. However, by the end of the C ++ 11 process, this language feature was added.
for_each
" ". . , , ++ 11 .
LWG- 2747 ++ 17.
, , , , ( ), , , , , , - , .
: , ++ 17 . , ++ 11, , for_each
.
:
, , ?
N4660, ++ 17, ++ 98/03/11/14... , . . N4659 ( ):
15.8.3 / elision [class.copy.elision]
, / ,...
return
, ( , ( 18.3)) ( cv-qualification) , / ,
.