33,311
社区成员
发帖
与我相关
我的任务
分享
class A
{
public:
A operator +(const A&,const A&);
};
class A
{
int value;
public:
A operator +(const A&other)
{
A a;
a.value = this->value + other.value;
return a;
}
};
class B
{
public:
int value;
};
B operator+(const B& a, const B& b)
{
B t;
t.value = a.value + b.value;
return a;
}
class A{
int value;
public:
A operator +(const A&other) {
A a;
a.value = this->value + other.value;
return a;
}
};
[code=c]
class A{
public:
int value;
};
A operator+(const A& a, const A& b) {
A t;
t.value = a.value + b.value;
return a;
}
[/code]