[vtk-developers] const correctness
Sean McBride
sean at rogue-research.com
Thu Feb 10 14:15:20 EST 2011
On Thu, 10 Feb 2011 12:50:49 -0500, Berk Geveci said:
>Am I correct in assuming that almost every single subclass of VTK in other
>projects will fail to compile after this change? Are there any other
>backwards compatibility implications of this? Also, what are the advantages
>of this change?
Berk,
From my perspective, as a client of VTK's public API, the advantage is
that sometimes I have something that really is const, say a const string
like "foo", and I need to pass it to a VTK API that takes char*. If VTK
mutates the buffer I've passed, I'll crash. If it doesn't mutate, I'm
ok, but the compiler will rightly complain that I'm implicitly casting
away constness.
Tom,
Maybe I'm just not enough of a C++ expert, but I don't get this:
<http://review.source.kitware.com/#patch,unified,882,1,Common/
vtkInformationDoubleKey.cxx>
Why add the 2nd Get with an identical implementation?
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the vtk-developers
mailing list