Re: [ROOT] Const correctness

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Dec 14 2000 - 15:06:42 MET


Hi George,

The version 3.00 of Root currently in the CVS repository includes all
your requested changes and more. I have revisited most classes in the system
to introduce const where it should be const.
Obviously, as you point out, this may introduce some backward incompatibility
in your own classes deriving from the Root classes.
For people upgrading to the new version, be careful.
If your class redefines the functions such as ls, Print, Hash, Compare, Clone,
you have to make these functions const in your class.

Rene Brun

George A. Heintzelman wrote:
> 
> Root guys,
> 
> Is there any plan in the works for making the basic root interfaces
> more const correct? The fact that several key virtual functions in
> TObject are not const correct is frequently disconcerting to me. A
> non-comprehensive list:
> 
> Copy(), Compare(), Clone(), Hash(), IsEqual(), Print()
> 
> should all be const and/or take const arguments and do not.
> 
> I am getting tired of having to use const_cast in my own const correct
> functions which call these and others, and hoping that there is some
> hope for the future...
> 
> The only trouble, of course, is that this change to the interface will
> require changes to the users code which override the changed functions,
> though there might be ways to avoid that. Still, this is not a small
> thing, so I would not want to see it in a patchlevel upgrade.
> 
> George Heintzelman
> gah@bnl.gov



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:39 MET