一段代码,猜猜输出什么?
#include < iostream >
struct MyType {
MyType() {}
};
int fun(MyType && d) {
return 1;
}
int fun(MyType d) {
return 9;
}
int main() {
MyType st1;
MyType && st2 = {};
std: :cout << fun(st1);
std: :cout << fun(st2);
return 0;
}
网友评论