Skip to content

Commit a15bc10

Browse files
committed
STYLE: Prefer = default to explicitly trivial implementations
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.
1 parent f843db8 commit a15bc10

7 files changed

+8
-11
lines changed

include/itkArrivalFunctionToPathFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class ITK_TEMPLATE_EXPORT ArrivalFunctionToPathCommand : public itk::Command
8484
}
8585

8686
protected:
87-
ArrivalFunctionToPathCommand() {}
88-
~ArrivalFunctionToPathCommand() override {}
87+
ArrivalFunctionToPathCommand() = default;
88+
~ArrivalFunctionToPathCommand() override = default;
8989

9090
private:
9191
typename FilterType::Pointer m_Filter;

include/itkArrivalFunctionToPathFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ ArrivalFunctionToPathFilter<TInputImage, TOutputPath>::ArrivalFunctionToPathFilt
3434

3535

3636
template <typename TInputImage, typename TOutputPath>
37-
ArrivalFunctionToPathFilter<TInputImage, TOutputPath>::~ArrivalFunctionToPathFilter()
38-
{}
37+
ArrivalFunctionToPathFilter<TInputImage, TOutputPath>::~ArrivalFunctionToPathFilter() = default;
3938

4039
template <typename TInputImage, typename TOutputPath>
4140
void

include/itkIterateNeighborhoodOptimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class MinimalPathExtraction_EXPORT IterateNeighborhoodOptimizer : public SingleV
122122

123123
protected:
124124
IterateNeighborhoodOptimizer();
125-
~IterateNeighborhoodOptimizer() override{};
125+
~IterateNeighborhoodOptimizer() override = default;
126126
void
127127
PrintSelf(std::ostream & os, Indent indent) const override;
128128

include/itkPhysicalCentralDifferenceImageFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class ITK_TEMPLATE_EXPORT PhysicalCentralDifferenceImageFunction
132132

133133
protected:
134134
PhysicalCentralDifferenceImageFunction();
135-
~PhysicalCentralDifferenceImageFunction() override{};
135+
~PhysicalCentralDifferenceImageFunction() override = default;
136136
void
137137
PrintSelf(std::ostream & os, Indent indent) const override;
138138

include/itkSingleImageCostFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class ITK_TEMPLATE_EXPORT SingleImageCostFunction : public SingleValuedCostFunct
151151

152152
protected:
153153
SingleImageCostFunction();
154-
~SingleImageCostFunction() override {}
154+
~SingleImageCostFunction() override = default;
155155
void
156156
PrintSelf(std::ostream & os, Indent indent) const override;
157157

include/itkSpeedFunctionPathInformation.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ SpeedFunctionPathInformation<TPoint>::SpeedFunctionPathInformation()
3131

3232

3333
template <typename TPoint>
34-
SpeedFunctionPathInformation<TPoint>::~SpeedFunctionPathInformation()
35-
{}
34+
SpeedFunctionPathInformation<TPoint>::~SpeedFunctionPathInformation() = default;
3635

3736

3837
template <typename TPoint>

include/itkSpeedFunctionToPathFilter.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ SpeedFunctionToPathFilter<TInputImage, TOutputPath>::SpeedFunctionToPathFilter()
3333

3434

3535
template <typename TInputImage, typename TOutputPath>
36-
SpeedFunctionToPathFilter<TInputImage, TOutputPath>::~SpeedFunctionToPathFilter()
37-
{}
36+
SpeedFunctionToPathFilter<TInputImage, TOutputPath>::~SpeedFunctionToPathFilter() = default;
3837

3938

4039
template <typename TInputImage, typename TOutputPath>

0 commit comments

Comments
 (0)