[vtk-developers] Const correctness for string methods

David Thompson dcthomp at sandia.gov
Mon Jan 19 20:49:35 EST 2004


> > But at least it's possible to list real problems the float -> double
> > conversion fixed (although it caused plenty of mayhem, may internally
> Very true, float->double was needed, whereas const correctness is mostly for
> the aspergers part of us wanting it tidy and consistent.
Without const methods, it can be very difficult to interface with other
C++ libraries that _do_ use const. For example, a widget inherited from
Qt that references VTK objects will have trouble calling any VTK members
from a const Qt member. A lot of these are simply methods to update GUI
strings with the name of some selected array or summary information
(GetNumberOfPoints, ...) Declaring const methods for getting at member
variables should be relatively painless as long as the non-const
versions also exist.

		David




More information about the vtk-developers mailing list