I already know automatic move is not woking with the function which return value from Rvalue Reference input. But why?
Below is example code which automatic move is not working with.
Widget makeWidget(Widget&& w) {
....
return w; // Compiler copies w. not move it.
}
If the function input is from copy by value, automatic move works.
Widget makeWidget(Widget w) {
....
return w; // Compiler moves w. not copy it.
}