你在講什麼?constructor的return是void哪有甚麼回傳function return都是rvalue 建構子也是我終於看懂你的問題了......因為你的g不是回傳reference type當然不會動到reference的constructor阿......你的問題是連最基本的三種呼叫和回傳都沒搞懂call by value, call by address,call by reference
所以是RVO關不掉?RVO是c++11的standard名稱是copy elision我把原PO的code改了一下 http://cpp.sh/4u43728行VS報錯內容'return': cannot convert from 'myClass' to 'myClass &&'Clang報錯內容rvalue reference to type 'myClass' cannot bind to lvalue of type 'myClass'