且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在没有创建副本的情况下返回对象?

更新时间:2022-03-19 21:28:08

感谢@seaman 的帮助我发现了我的错误.通过改变

thank you @seaman with your help I found my mistake. by changing

TestCopy x=*this;

const TestCopy &x=*this;

问题已解决