On the other hand more methods are const then shows up in the list of
methods in the HTML doc. Check the *.h file to see the thruth. We'll
fix the THtml class to show correctly const.
Cheers, Fons.
Rutger van der Eijk wrote:
>
> Hi,
>
> I couldn't find any reference on roottalk to this subject yet, so here I
> go.
>
> I noticed that in the root classes (including TObject) almost never
> memberfunctions which don't (and shouldn't!) change datamembers of a class
> are declared constant.
> For example most 'getters' should be declared constant (Except in
> the exceptional case where you want a user of a class to be able to change
> a datamember (which usually indicates an 'ill formed' (i.e. non OO)
> program.)) Another example is for example the TObject::Print() member
> which (at least in my opinion) should not change the object.
> Of course C++ does not force anyone to declare memberfunctions
> constant if they in fact don't change the object. I do think it
> is a sort of convention in structered/OO programming in C++ though. I see
> that this might not be an issue of the highets priority but I think it
> should be changed in the (near) future.
>
> Anybody have (other) opinions about this?
>
> Rutger
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910