我模拟了一下你的代码,再我的VS2022上没有任何问题
class LPoint
{
public:
int x;
LPoint(int _x)
{
x=_x;
}
};
class LVAR
{
public:
int x;
LVAR(int _x)
{
x=_x;
}
operator LPoint() { return LPoint(x); }
};
void Press(LPoint &l)
{
printf("x=%d\n",l.x);
}
int main()
{
LVAR d(10);
vector<LVAR> v;
v.push_back(d);
Press(LPoint(v[0]));
return 0;
}
【 在 mazheng75 的大作中提到: 】
: 都加了 问题如旧 谢谢
--
FROM 140.206.195.*