阅读背景:

c++对象作为返回值:拷贝还是引用?

来源:互联网 

I wanted to test how C++ behaves when the return value of a function is an object. I made this little example to watch how many bytes are allocated and determine whether the compiler makes a copy of object (like when object is passed as a parameter) or instead returns some kind of reference. I wanted to test how C++ behaves when the retur




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: