VTK8.2RC2: vtkMath.h misses #include <algorithm> for C++17

classic Classic list List threaded Threaded
2 messages Options
lp
Reply | Threaded
Open this post in threaded view
|

VTK8.2RC2: vtkMath.h misses #include <algorithm> for C++17

lp
Hi all,

In VTK8.2 the function vtkMath::ClampValue in vtkMath.h uses the standard
library function std::clamp, if a C++17 compiler is found. But the include
that contains std::clamp (<algorithm>) is not listed in vtkMath.h.
This leads to a compile error, when using VTK8.2RC2 in a project that is
compiled with C++17.

From my understanding this could be fixed by adding

#include <algorithm>

at the beginning of vtkMath.h inside an #if statement that checks for C++17.

Regards,
Lukas



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: VTK8.2RC2: vtkMath.h misses #include <algorithm> for C++17

Sean McBride
On Fri, 11 Jan 2019 11:03:28 -0700, lp said:

>In VTK8.2 the function vtkMath::ClampValue in vtkMath.h uses the standard
>library function std::clamp, if a C++17 compiler is found. But the include
>that contains std::clamp (<algorithm>) is not listed in vtkMath.h.
>This leads to a compile error, when using VTK8.2RC2 in a project that is
>compiled with C++17.
>
>From my understanding this could be fixed by adding
>
>#include <algorithm>
>
>at the beginning of vtkMath.h inside an #if statement that checks for C++17.

That's probably my fault... I'll make a patch...

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers