Removal of math.h from VTK headers

In !7572, I remove #include <math.h> from vtkSetGet.h (which is included by all VTK class headers). The reason for the removal is modernization of the code, but of course it will cause some (easily fixed) compile errors in apps and libraries that use VTK.

Do people have any opinions on the best time to merge this change?

1 Like

Thanks for asking. The change has a good reason and can only cause a tiny inconvenience, so I don’t think any developer would complain.

1 Like

I think “small” inconvenience, but not quite “tiny” :wink:

For example it required the addition of #include <cmath> to around 20 .cxx files in Paraview, and will probably require a similar number of changes in Slicer.

@dgobbi - if anything, the change was overdue. Modernizing code, but also not including gratuitous includes in places where they don’t make sense.

+1 :green_heart:

I should add that one of my reasons for the change is that it hides math.h from the wrappers. The handling of system & compiler includes by the wrappers is imperfect, so moving them into the .cxx files where the wrappers don’t see them makes wrapping more robust.

This change seems to have support, so I’ll merge tonight unless there are objections.