[vtk-developers] Const correctness for string methods
John Biddiscombe
jbiddiscombe at skippingmouse.co.uk
Mon Jan 19 17:54:17 EST 2004
> I understand the general software engineering principle at work here,
> but
> from a practical level with regard to VTK, does either the extra safety
> or the optimization really buy you much in practice? Are we seeing lots
> of problems because of a violation of implicit (rather than declared)
> constness?
OK. I'll drop const correctness if we can have exception handling thrown in
instead :)
> 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.
Seb wrote...
>And you back that up with ?...
Const functions and const parameters allow the compiler to optimize better
because they can assume that variables assigned before a call to a "const"
function haven't been modified inside it. I'm willing to concede that in the
case of vtk it'll save us essentially nothing in overall speed.
JB
Exception handling ranks alongside float->double from my point of view
though. it is needed.
More information about the vtk-developers
mailing list