Re: [ROOT] static member in interactive session

From: Gero Flucke (gero.flucke@desy.de)
Date: Thu Oct 28 2004 - 14:59:01 MEST


On Thu, 28 Oct 2004, ribordy wrote:

> Hi rooters,
> I'm not sure what's wrong with that:
> I have a class A with a public bool static member f. I generate a
> dictionary and use it in an interactive session. There is a method M()
> printing the value of f.
>
> In the interactive session, I simply do:
>
> A a; a.M(); --> print f=true (that's how I initialized it)
> a.f=false; a.M(); --> print f=true (shouldn't it be false ?)
>
> of course, this problem disappears when f is not declared as a static
> member.

Hi,
I had the same problem (unfortunately with the old ROOT 3.10_03, not
tested with 4.X) and had to work around it by calling a static member
function that changes the static member. In compiled code all is fine.

Cheers

	Gero

PS: on linux, pentium III

--
-----------------------------------------------------------------------
Gero Flucke
1a / 603
DESY
Notkestr. 85
22607 Hamburg
+49-(0)40-8998-2454



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET