ENH: Default override VNL 1D FFT class destructors#2815
Conversation
Mark class destructors with `override`.
Fixes:
```
In file included from /Users/builder/externalModules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx:27:
In file included from /Users/builder/externalModules/Filtering/FFT/include/itkComplexToComplex1DFFTImageFilter.h:122:
In file included from /Users/builder/externalModules/Filtering/FFT/include/itkComplexToComplex1DFFTImageFilter.hxx:23:
[CTest: warning matched] /Users/builder/externalModules/Filtering/FFT/include/itkVnlComplexToComplex1DFFTImageFilter.h:61:11:
warning: '~VnlComplexToComplex1DFFTImageFilter' overrides a destructor but is not marked 'override' [-Winconsistent-missing-destructor-override]
virtual ~VnlComplexToComplex1DFFTImageFilter() {}
^
```
and
```
In file included from /Users/builder/externalModules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx:25:
In file included from /Users/builder/externalModules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx:27:
In file included from /Users/builder/externalModules/Filtering/FFT/include/itkForward1DFFTImageFilter.h:101:
In file included from /Users/builder/externalModules/Filtering/FFT/include/itkForward1DFFTImageFilter.hxx:23:
[CTest: warning matched] /Users/builder/externalModules/Filtering/FFT/include/itkVnlForward1DFFTImageFilter.h:62:11:
warning: '~VnlForward1DFFTImageFilter' overrides a destructor but is not marked 'override' [-Winconsistent-missing-destructor-override]
virtual ~VnlForward1DFFTImageFilter() {}
^
```
raised for example at:
https://open.cdash.org/viewBuildError.php?type=1&onlydeltap&buildid=7512728
This check replaces default bodies of special member functions with = default;. The explicitly defaulted function declarations enable more opportunities in optimization, because the compiler might treat explicitly defaulted functions as trivial. Additionally, the C++11 use of = default more clearly expreses the intent for the special member functions.
tbirdso
left a comment
There was a problem hiding this comment.
While we're at it we should fix similar constructor/destructors in the FFTW equivalent classes (itkFFTWComplexToComplex1DFFTImageFilter, itkFFTWForward1DFFTImageFilter, itkFFTWInverse1DFFTImageFilter). @jhlegarreta would you prefer that I add this in a separate PR?
Seems reasonable. I think best is to amend the commits in this PR. Please go ahead. Not sure if it was me that again missed them or whether they are not raising warnings. |
|
lgtm |
|
@jhlegarreta it looks like I don't have permission to amend your branch, I'll just make the changes in another PR. On second review FFTW classes are acting a little differently anyway with non-default constructors and destructors. |
…faultOverrideVnl1DFFTClassDestructors ENH: Default override VNL 1D FFT class destructors
overridePR Checklist