>And I forgot to say, that AllJets::Algorithm is a public enumeration of
>class AllJets. The compiler only complains when the argument is expected
>to be of type "AllJets::Algorithm", because in the " ... ? ... : ... "
>construct the 2nd possibility "G__Mint(libp->para[1])" appearently has the
>wrong type, i.e. int, and in general the conversion int->enumeration is
>not allowed.
Thanks for pointing this out. This was a bug. I fixed it in cint5.13.63
which will be copied to CERN shortly.
One lmitation remains, Please be careful about following situation when you
use reference to enum type. If you have a function receiving reference to
enum, you can't give raw enum value to it. You must always allocate a enum
type variable, then give it to the function. C++ compiler rejects such error,
unfortunately cint doesn't. Please avoid such error.
class A {
public:
enum B { x,y,z };
void f(B& a) { a = z; }
};
void g() {
A a;
A::B b=x;
a.f(b); // OK , z is assigned to b
a.f(A::x); // BAD, tries to assign z on A::x
// C++ compiler rejects this,
// cint unfortunately accepts this and changes value of A::x
} // This means A::x changes to 2 after this point.
Masaharu Goto