阅读背景:

为什么在删除move构造函数时我的对象没有被复制?

来源:互联网 

I'm trying to use this code to demonstrate the use of the copy-constructor. My presumption was that when I have a function that returns by value, my compiler will, by default, perform a move of the object. But when the move-constructor is unavailable, the compiler will copy instead (in C++03, the compiler would copy when returning by-value). So why in the following example does the compiler try to call the explicitly-deleted move-constructor instead of the available copy-constructor? I'm compiling this in GCC 4.7.2.I'm trying to use this code to demonstrate the




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

分享到: