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
hjmjohnson committed Feb 17, 2020
1 parent 17541d4 commit 3866646
Show file tree
Hide file tree
Showing 34 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions applications/rtkprojectionmatrix/rtkprojectionmatrix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ template <class TInput, class TCoordRepType, class TOutput = TCoordRepType>
class StoreSparseMatrixSplatWeightMultiplication
{
public:
StoreSparseMatrixSplatWeightMultiplication(){};
~StoreSparseMatrixSplatWeightMultiplication(){};
StoreSparseMatrixSplatWeightMultiplication()= default;;
~StoreSparseMatrixSplatWeightMultiplication()= default;;
bool
operator!=(const StoreSparseMatrixSplatWeightMultiplication &) const
{
Expand Down
2 changes: 1 addition & 1 deletion include/rtkConjugateGradientOperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace rtk

template <typename OutputImageType>
ConjugateGradientOperator<OutputImageType>::ConjugateGradientOperator()
{}
= default;

template <typename OutputImageType>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkConstantImageSource.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ConstantImageSource<TOutputImage>::ConstantImageSource()

template <class TOutputImage>
ConstantImageSource<TOutputImage>::~ConstantImageSource()
{}
= default;

template <class TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkCyclicDeformationImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ITK_EXPORT CyclicDeformationImageFilter : public itk::ImageToImageFilter<T
itkSetMacro(Frame, unsigned int);

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

void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDPExtractShroudSignalImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace rtk

template <class TInputPixel, class TOutputPixel>
DPExtractShroudSignalImageFilter<TInputPixel, TOutputPixel>::DPExtractShroudSignalImageFilter()
{}
= default;

template <class TInputPixel, class TOutputPixel>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDaubechiesWaveletsConvolutionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DaubechiesWaveletsConvolutionImageFilter<TImage>::DaubechiesWaveletsConvolutionI

template <typename TImage>
DaubechiesWaveletsConvolutionImageFilter<TImage>::~DaubechiesWaveletsConvolutionImageFilter()
{}
= default;

template <typename TImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDeconstructImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace rtk
// Default Constructor
template <class TImage>
DeconstructImageFilter<TImage>::DeconstructImageFilter()
{}
= default;

/////////////////////////////////////////////////////////
// PrintSelf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace rtk
template <class TInputImage, class TOutputImage>
DisplacedDetectorForOffsetFieldOfViewImageFilter<TInputImage,
TOutputImage>::DisplacedDetectorForOffsetFieldOfViewImageFilter()
{}
= default;

/**
* When the detector is displaced, one needs to zero pad the input data on the
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDisplacedDetectorImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace rtk

template <class TInputImage, class TOutputImage>
DisplacedDetectorImageFilter<TInputImage, TOutputImage>::DisplacedDetectorImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDrawConvexImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace rtk

template <class TInputImage, class TOutputImage>
DrawConvexImageFilter<TInputImage, TOutputImage>::DrawConvexImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFDKWarpBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace rtk

template <class TInputImage, class TOutputImage, class TDeformation>
FDKWarpBackProjectionImageFilter<TInputImage, TOutputImage, TDeformation>::FDKWarpBackProjectionImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage, class TDeformation>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFFTRampImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace rtk

template <class TInputImage, class TOutputImage, class TFFTPrecision>
FFTRampImageFilter<TInputImage, TOutputImage, TFFTPrecision>::FFTRampImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage, class TFFTPrecision>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFieldOfViewImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace rtk

template <class TInputImage, class TOutputImage>
FieldOfViewImageFilter<TInputImage, TOutputImage>::FieldOfViewImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage>
bool
Expand Down
2 changes: 1 addition & 1 deletion include/rtkJosephBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ JosephBackProjectionImageFilter<TInputImage,
TInterpolationWeightMultiplication,
TSplatWeightMultiplication,
TSumAlongRay>::JosephBackProjectionImageFilter()
{}
= default;

template <class TInputImage,
class TOutputImage,
Expand Down
2 changes: 1 addition & 1 deletion include/rtkMultiplyByVectorImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace rtk
//
template <class TInputImage>
MultiplyByVectorImageFilter<TInputImage>::MultiplyByVectorImageFilter()
{}
= default;

template <class TInputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkNesterovUpdateImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ NesterovUpdateImageFilter<TImage>::NesterovUpdateImageFilter()

template <typename TImage>
NesterovUpdateImageFilter<TImage>::~NesterovUpdateImageFilter()
{}
= default;

template <typename TImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkOraLookupTableImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ITK_EXPORT OraLookupTableImageFilter
}

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

private:
Expand Down
2 changes: 1 addition & 1 deletion include/rtkPhaseReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace rtk
{

PhaseReader::PhaseReader() {}
PhaseReader::PhaseReader() = default;

void
PhaseReader::PrintSelf(std::ostream & os, itk::Indent indent) const
Expand Down
2 changes: 1 addition & 1 deletion include/rtkPolynomialGainCorrectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace rtk

template <class TInputImage, class TOutputImage>
PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::PolynomialGainCorrectionImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkRayQuadricIntersectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace rtk

template <class TInputImage, class TOutputImage>
RayQuadricIntersectionImageFilter<TInputImage, TOutputImage>::RayQuadricIntersectionImageFilter()
{}
= default;

template <class TInputImage, class TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkReconstructImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace rtk
// Default Constructor
template <class TImage>
ReconstructImageFilter<TImage>::ReconstructImageFilter()
{}
= default;


/////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion include/rtkReg1DExtractShroudSignalImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace rtk

template <class TInputPixel, class TOutputPixel>
Reg1DExtractShroudSignalImageFilter<TInputPixel, TOutputPixel>::Reg1DExtractShroudSignalImageFilter()
{}
= default;

template <class TInputPixel, class TOutputPixel>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkSelectOneProjectionPerCycleImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace rtk

template <typename ProjectionStackType>
SelectOneProjectionPerCycleImageFilter<ProjectionStackType>::SelectOneProjectionPerCycleImageFilter()
{}
= default;

template <typename ProjectionStackType>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkVarianObiRawImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace rtk

template <typename TInputImage, typename TOutputImage>
VarianObiRawImageFilter<TInputImage, TOutputImage>::VarianObiRawImageFilter()
{}
= default;

template <typename TInputImage, typename TOutputImage>
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkZengBackProjectionImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ITK_EXPORT ZengBackProjectionImageFilter : public BackProjectionImageFilte

protected:
ZengBackProjectionImageFilter();
~ZengBackProjectionImageFilter() ITK_OVERRIDE {}
~ZengBackProjectionImageFilter() ITK_OVERRIDE = default;

/** Apply changes to the input image requested region. */
void
Expand Down
2 changes: 1 addition & 1 deletion include/rtkZengForwardProjectionImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ITK_EXPORT ZengForwardProjectionImageFilter : public ForwardProjectionImag

protected:
ZengForwardProjectionImageFilter();
~ZengForwardProjectionImageFilter() ITK_OVERRIDE {}
~ZengForwardProjectionImageFilter() ITK_OVERRIDE = default;

void
GenerateInputRequestedRegion() ITK_OVERRIDE;
Expand Down
2 changes: 1 addition & 1 deletion src/rtkConvexShape.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace rtk
{

ConvexShape ::ConvexShape() {}
ConvexShape ::ConvexShape() = default;

bool
ConvexShape ::IsInside(const PointType & /*point*/) const
Expand Down
2 changes: 1 addition & 1 deletion src/rtkDigisensGeometryReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <itkVersor.h>
#include <itkCenteredEuler3DTransform.h>

rtk::DigisensGeometryReader ::DigisensGeometryReader() {}
rtk::DigisensGeometryReader ::DigisensGeometryReader() = default;

void
rtk::DigisensGeometryReader ::GenerateData()
Expand Down
2 changes: 1 addition & 1 deletion src/rtkIntersectionOfConvexShapes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace rtk
{

IntersectionOfConvexShapes ::IntersectionOfConvexShapes() {}
IntersectionOfConvexShapes ::IntersectionOfConvexShapes() = default;

void
IntersectionOfConvexShapes ::SetConvexShapes(const ConvexShapeVector & _arg)
Expand Down
2 changes: 1 addition & 1 deletion src/rtkQuadricShape.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace rtk
{

QuadricShape ::QuadricShape() {}
QuadricShape ::QuadricShape() = default;

bool
QuadricShape ::IsInside(const PointType & point) const
Expand Down
2 changes: 1 addition & 1 deletion src/rtkReg23ProjectionGeometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rtk::Reg23ProjectionGeometry::Reg23ProjectionGeometry()
: rtk::ThreeDCircularProjectionGeometry()
{}

rtk::Reg23ProjectionGeometry::~Reg23ProjectionGeometry() {}
rtk::Reg23ProjectionGeometry::~Reg23ProjectionGeometry() = default;

bool
rtk::Reg23ProjectionGeometry::AddReg23Projection(const PointType & sourcePosition,
Expand Down
2 changes: 1 addition & 1 deletion src/rtkThreeDCircularProjectionGeometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <itkCenteredEuler3DTransform.h>
#include <itkEuler3DTransform.h>

rtk::ThreeDCircularProjectionGeometry::ThreeDCircularProjectionGeometry() {}
rtk::ThreeDCircularProjectionGeometry::ThreeDCircularProjectionGeometry() = default;

double
rtk::ThreeDCircularProjectionGeometry::ConvertAngleBetween0And360Degrees(const double a)
Expand Down
2 changes: 1 addition & 1 deletion src/rtkWatcherForResourceProbe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ WatcherForResourceProbe ::operator=(const WatcherForResourceProbe & watch)
return *this;
}

WatcherForResourceProbe ::~WatcherForResourceProbe() {}
WatcherForResourceProbe ::~WatcherForResourceProbe() = default;

} // namespace rtk
2 changes: 1 addition & 1 deletion test/rtkargsinfomanagertest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class args_info_test
public:
int testVar{ true };
int verbose_flag{ 0 };
args_info_test() {}
args_info_test() = default;
};

class cleanup_functor
Expand Down

0 comments on commit 3866646

Please sign in to comment.