For example (not tested):
class a {
private:
int x
public:
void set_a(int y) {x=y;}
};
class b {
private:
int var;
public:
a operator-(const b &oper2) {
a result;
result.set_a(var - oper2.var);
return(result);
}
Obviously this won't work since the class b didn't know anything about class
a. And thus it cannot return an object with type a. How to make it possible?
Thanks.