InsightSoftwareConsortium / ITKIsotropicWavelets

External Module for ITK, implementing Isotropic Wavelets and Riesz Filter for multiscale phase analysis.
Apache License 2.0
13 stars 11 forks source link

ENH: Use std::enable_if instead of itk::EnableIf #153

Closed phcerdan closed 2 years ago

phcerdan commented 2 years ago

itk::EnableIf was marked as legacy in itk 5.3

phcerdan commented 2 years ago

Fix error after raised after updating CI to itk5.3 in #152

dzenanz commented 2 years ago

In file included from /work/ITK-cp37-cp37m-manylinux2014_x64/Wrapping/itkFrequencyShrinkViaInverseFFTImageFilter.cxx:16: In file included from /work/include/itkFrequencyShrinkViaInverseFFTImageFilter.h:21: /work/include/itkShrinkDecimateImageFilter.h:124:17: error: no type named 'enable_if_t' in namespace 'std' typename std::enable_if_t<std::numeric_limits::is_integer, TOutputType>


/work/include/itkShrinkDecimateImageFilter.h:124:28: error: expected member name or ';' after declaration specifiers
  typename std::enable_if_t<std::numeric_limits<TOutputType>::is_integer, TOutputType>
  ~~~~~~~~~~~~~~~~~~~~~~~~~^
2 errors generated.
phcerdan commented 2 years ago

I thought ITK transitioned to C++14. Isn't it enabled in the CI? I will change it to the C++11 version

dzenanz commented 2 years ago

C++14 should be enabled in the CI. Let's see whether this builds.

phcerdan commented 2 years ago

I think the typename wasn't needed when using std::enable_if_t. However, I wonder why locally (gcc 12) I don't see this error.

dzenanz commented 2 years ago

CppReference says that's how enable_if_t is defined:

template< bool B, class T = void >
using enable_if_t = typename enable_if<B,T>::type;
dzenanz commented 2 years ago

Everything compiles without issue now, but half the tests segfault.

phcerdan commented 2 years ago

I don't see it these seg faults locally. @dzenanz could you try to reproduce it locally please?

dzenanz commented 2 years ago

I cannot reproduce the segfaults locally. Let's merge after the CI finishes.

dzenanz commented 2 years ago

The segfaults in the CI break the CI's usefulness. #152 is now rebased on master, and it absolutely fails. We should probably fix it.