weird compile errors when setting -DCMAKE_CXX_STANDARD=17

gcc-10 on ubuntu 18.04

When the python wrappers are selected be built and CMAKE_CXX_STANDARD=17 I get weird error about type_traits way down low in the c++ standard library. I think it has to do with the python bindings may be hard coding std=c++11.

I am not totally sure I understand what the issue is, but gives and error like

_Tp  does not refer to a value 
// referencing this code snippet  in type_traits
: public integral_constant<bool, _GLIBCXX_BUILTIN_IS_SAME_AS(_Tp, _Up)>

there were some other issues around throw(itk::object) which I replaced with noexcept(false) but that didn’t seemed relevant to the issue above.

I also turned off the python bindings and it appears to be compiling fine.

SWIG’s docs say:

… work has only just begun on adding C++17 support. SWIG-4.0.0 is the first version to support any C++17 features.

1 Like

that is very helpful, from pursuing it looked like itk should compile with 17 just fine, but didn’t think about it interfering with swig wrapping.