Skip to content

Commit

Permalink
STYLE: Prefer = default to explicitly trivial implementations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhlegarreta committed Oct 12, 2021
1 parent 1daf218 commit 85e80f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ITK_TEMPLATE_EXPORT ComplexToComplex1DFFTImageFilter : public ImageToImage

protected:
ComplexToComplex1DFFTImageFilter();
~ComplexToComplex1DFFTImageFilter() override{};
~ComplexToComplex1DFFTImageFilter() override = default;

void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Filtering/FFT/include/itkForward1DFFTImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ITK_TEMPLATE_EXPORT Forward1DFFTImageFilter : public ImageToImageFilter<TI

protected:
Forward1DFFTImageFilter();
~Forward1DFFTImageFilter() override{};
~Forward1DFFTImageFilter() override = default;

void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
2 changes: 1 addition & 1 deletion Modules/Filtering/FFT/include/itkInverse1DFFTImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ITK_TEMPLATE_EXPORT Inverse1DFFTImageFilter : public ImageToImageFilter<TI

protected:
Inverse1DFFTImageFilter();
~Inverse1DFFTImageFilter() override{};
~Inverse1DFFTImageFilter() override = default;

void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down
4 changes: 2 additions & 2 deletions Modules/Filtering/FFT/include/itkVnlInverse1DFFTImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class ITK_TEMPLATE_EXPORT VnlInverse1DFFTImageFilter : public Inverse1DFFTImageF
void
GenerateData() override;

VnlInverse1DFFTImageFilter() {}
~VnlInverse1DFFTImageFilter() override{};
VnlInverse1DFFTImageFilter() = default;
~VnlInverse1DFFTImageFilter() override = default;
};

} // end namespace itk
Expand Down

0 comments on commit 85e80f1

Please sign in to comment.