From 1ff5932f4b219a73b2f531759f697fc9df786c78 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 6 Feb 2025 17:16:33 +0100 Subject: [PATCH] STYLE: Move empty `const` member functions from .hxx to .h Moved the member function definitions of `const`member functions that have an empty member function definition from their "itk*.hxx" file to the corresponding "itk*.h" file, and into their class definition. Found by regular expression `^..[^:,].+\) const\r\n{}` in "itk*.hxx" files. - Follow-up to pull request https://github.com/InsightSoftwareConsortium/ITK/pull/5198 commit b94770d8746133a441df1796e3d1628c6935adfc "STYLE: Move empty member functions with empty param list from .hxx to .h" --- Modules/Filtering/LabelMap/include/itkLabelObjectLine.h | 3 ++- Modules/Filtering/LabelMap/include/itkLabelObjectLine.hxx | 8 -------- .../Common/include/itkEuclideanDistancePointMetric.h | 4 +++- .../Common/include/itkEuclideanDistancePointMetric.hxx | 7 ------- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Modules/Filtering/LabelMap/include/itkLabelObjectLine.h b/Modules/Filtering/LabelMap/include/itkLabelObjectLine.h index 25e63b7f9bb..fec4b48ec6a 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelObjectLine.h +++ b/Modules/Filtering/LabelMap/include/itkLabelObjectLine.h @@ -97,7 +97,8 @@ class ITK_TEMPLATE_EXPORT LabelObjectLine PrintHeader(std::ostream & os, Indent indent) const; virtual void - PrintTrailer(std::ostream & os, Indent indent) const; + PrintTrailer(std::ostream & itkNotUsed(os), Indent itkNotUsed(indent)) const + {} private: IndexType m_Index{}; diff --git a/Modules/Filtering/LabelMap/include/itkLabelObjectLine.hxx b/Modules/Filtering/LabelMap/include/itkLabelObjectLine.hxx index 70a0e1c3741..67bbd6fbc78 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelObjectLine.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelObjectLine.hxx @@ -126,14 +126,6 @@ LabelObjectLine::PrintSelf(std::ostream & os, Indent indent) co os << indent << "Index: " << this->m_Index << std::endl; os << indent << "Length: " << this->m_Length << std::endl; } - -/** - * Define a default print trailer for all objects. - */ -template -void -LabelObjectLine::PrintTrailer(std::ostream & itkNotUsed(os), Indent itkNotUsed(indent)) const -{} } // namespace itk #endif diff --git a/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.h b/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.h index 7696f8264e9..6eabca189cf 100644 --- a/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.h +++ b/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.h @@ -90,7 +90,9 @@ class ITK_TEMPLATE_EXPORT EuclideanDistancePointMetric /** Get the derivatives of the match measure. */ void - GetDerivative(const TransformParametersType & parameters, DerivativeType & Derivative) const override; + GetDerivative(const TransformParametersType & itkNotUsed(parameters), + DerivativeType & itkNotUsed(derivative)) const override + {} /** Get the match measure, i.e. the value for single valued optimizers. */ MeasureType diff --git a/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.hxx b/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.hxx index e34b6f62731..4085140f1bb 100644 --- a/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.hxx +++ b/Modules/Registration/Common/include/itkEuclideanDistancePointMetric.hxx @@ -128,13 +128,6 @@ EuclideanDistancePointMetric::Get return measure; } -template -void -EuclideanDistancePointMetric::GetDerivative( - const TransformParametersType & itkNotUsed(parameters), - DerivativeType & itkNotUsed(derivative)) const -{} - template void EuclideanDistancePointMetric::GetValueAndDerivative(