This was a CINT bug. I fixed this in cint5.13.90.
There is a workaround. The problem only happens when explicit type conversion
is used in return statement. If you re-write operator+ as follows, it should
work.
aint aint::operator+(aint j)
{
aint x(i+j.i);
return x;
}
Masaharu Goto
----------------------------------------------------------------
Dear rooters,
It seems that there is a problem with defining operators in CINT.
Here is a simple class definition:
class aint
{
public:
aint(int);
aint operator+(aint);
int i;
};
aint::aint(int j)
{
i=j;
}
aint aint::operator+(aint j)
{
return aint(i+j.i);
}
And now, if I use this class, here is the root answer:
root [5] .L test.C
root [6] aint i(0)
root [7] aint j(1)
root [8] aint k=i+j;
Error: Return type mismatch operator+()
FILE:/disk7/users/pbruel/optic/./test.C LINE:16
*** Interpreter error recovered ***
root [9]
I am running root 2.20.06 on HP.
Thanks in advance foor your help.