[ROOT] unexpected choice of operator=()

From: James Peachey (peachey@bigband.gsfc.nasa.gov)
Date: Fri Jan 26 2001 - 23:28:15 MET


Hi,

I have a class which I use both inside and outside of Root (2.25).
This class has a number of overloaded assignments, including:

class A {
  ...
  A::operator=(bool);
  A::operator=(int);
  ...
};

Outside of Root, the class behaves as I would expect:

  A = true; // calls operator=(bool)
  A = 137;  // calls operator=(int)

But inside Root:

  A = true; // calls operator=(bool)
  A = 137;  // calls operator=(bool)
                               ^^^^
Nothing I do, like casting the 137, or putting 137 into an int
variable, makes it call the "int" operator which I want.

Any idea what is causing this, and what my options are to fix it?

Thanks,
James



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:34 MET