G
Gernot Frisch
Hi,
I have a problem. I want to be able to write this:
a = b + d + c;
Where a can be a double or class A;
b,d,c can each indiviually be one of these: double, class A or class
B. The result of an addition is always class A, or double (double +
double can't be changed).
Know what I mean? I need a real lot of operators and at one point I
get ambiguity, since:
A a; B b; double d;
A = d;
d = A;
a = b + d + b;
operator+ is ambigious:
could be:
A A:perator+(const A&)
or:
A operator+(double, const C&)
Any idea? I'm hopelessly confused how to manage what I want to do...
-Gernot
I have a problem. I want to be able to write this:
a = b + d + c;
Where a can be a double or class A;
b,d,c can each indiviually be one of these: double, class A or class
B. The result of an addition is always class A, or double (double +
double can't be changed).
Know what I mean? I need a real lot of operators and at one point I
get ambiguity, since:
A a; B b; double d;
A = d;
d = A;
a = b + d + b;
operator+ is ambigious:
could be:
A A:perator+(const A&)
or:
A operator+(double, const C&)
Any idea? I'm hopelessly confused how to manage what I want to do...
-Gernot