Commit f118a65a authored by Hans Johnson's avatar Hans Johnson
Browse files

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.
parent 2ed660f1
......@@ -41,7 +41,7 @@ int TestVTKMImplicitDataArray(int, char*[])
struct Shim
{
Shim() {}
Shim() = default;
Shim(const ScalarFunction& f, vtkImageData* i)
: function(f)
, imageDataPtr(i)
......
......@@ -32,10 +32,10 @@
vtkStandardNewMacro(vtkmAverageToCells);
//------------------------------------------------------------------------------
vtkmAverageToCells::vtkmAverageToCells() {}
vtkmAverageToCells::vtkmAverageToCells() = default;
//------------------------------------------------------------------------------
vtkmAverageToCells::~vtkmAverageToCells() {}
vtkmAverageToCells::~vtkmAverageToCells() = default;
//------------------------------------------------------------------------------
int vtkmAverageToCells::RequestData(vtkInformation* vtkNotUsed(request),
......
......@@ -33,10 +33,10 @@
vtkStandardNewMacro(vtkmAverageToPoints);
//------------------------------------------------------------------------------
vtkmAverageToPoints::vtkmAverageToPoints() {}
vtkmAverageToPoints::vtkmAverageToPoints() = default;
//------------------------------------------------------------------------------
vtkmAverageToPoints::~vtkmAverageToPoints() {}
vtkmAverageToPoints::~vtkmAverageToPoints() = default;
//------------------------------------------------------------------------------
int vtkmAverageToPoints::RequestData(vtkInformation* vtkNotUsed(request),
......
......@@ -41,7 +41,7 @@ vtkmCleanGrid::vtkmCleanGrid()
}
//------------------------------------------------------------------------------
vtkmCleanGrid::~vtkmCleanGrid() {}
vtkmCleanGrid::~vtkmCleanGrid() = default;
//------------------------------------------------------------------------------
void vtkmCleanGrid::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -71,7 +71,7 @@ vtkmClip::vtkmClip()
}
//------------------------------------------------------------------------------
vtkmClip::~vtkmClip() {}
vtkmClip::~vtkmClip() = default;
//----------------------------------------------------------------------------
vtkMTimeType vtkmClip::GetMTime()
......
......@@ -38,10 +38,10 @@
vtkStandardNewMacro(vtkmContour);
//------------------------------------------------------------------------------
vtkmContour::vtkmContour() {}
vtkmContour::vtkmContour() = default;
//------------------------------------------------------------------------------
vtkmContour::~vtkmContour() {}
vtkmContour::~vtkmContour() = default;
//------------------------------------------------------------------------------
void vtkmContour::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -44,7 +44,7 @@ vtkmCoordinateSystemTransform::vtkmCoordinateSystemTransform()
}
//------------------------------------------------------------------------------
vtkmCoordinateSystemTransform::~vtkmCoordinateSystemTransform() {}
vtkmCoordinateSystemTransform::~vtkmCoordinateSystemTransform() = default;
//------------------------------------------------------------------------------
void vtkmCoordinateSystemTransform::SetCartesianToCylindrical()
......
......@@ -46,7 +46,7 @@ vtkmExternalFaces::vtkmExternalFaces()
}
//------------------------------------------------------------------------------
vtkmExternalFaces::~vtkmExternalFaces() {}
vtkmExternalFaces::~vtkmExternalFaces() = default;
//------------------------------------------------------------------------------
void vtkmExternalFaces::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -48,10 +48,10 @@ inline vtkm::cont::DataSet CopyDataSetStructure(const vtkm::cont::DataSet& ds)
} // anonymous namespace
//------------------------------------------------------------------------------
vtkmGradient::vtkmGradient() {}
vtkmGradient::vtkmGradient() = default;
//------------------------------------------------------------------------------
vtkmGradient::~vtkmGradient() {}
vtkmGradient::~vtkmGradient() = default;
//------------------------------------------------------------------------------
void vtkmGradient::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -48,7 +48,7 @@ vtkmHistogram::vtkmHistogram()
}
//------------------------------------------------------------------------------
vtkmHistogram::~vtkmHistogram() {}
vtkmHistogram::~vtkmHistogram() = default;
//-----------------------------------------------------------------------------
int vtkmHistogram::FillInputPortInformation(int port, vtkInformation* info)
......
......@@ -32,10 +32,10 @@
vtkStandardNewMacro(vtkmImageConnectivity);
//------------------------------------------------------------------------------
vtkmImageConnectivity::vtkmImageConnectivity() {}
vtkmImageConnectivity::vtkmImageConnectivity() = default;
//------------------------------------------------------------------------------
vtkmImageConnectivity::~vtkmImageConnectivity() {}
vtkmImageConnectivity::~vtkmImageConnectivity() = default;
//------------------------------------------------------------------------------
void vtkmImageConnectivity::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -46,7 +46,7 @@ vtkmLevelOfDetail::vtkmLevelOfDetail()
}
//------------------------------------------------------------------------------
vtkmLevelOfDetail::~vtkmLevelOfDetail() {}
vtkmLevelOfDetail::~vtkmLevelOfDetail() = default;
//------------------------------------------------------------------------------
void vtkmLevelOfDetail::SetNumberOfXDivisions(int num)
......
......@@ -68,10 +68,10 @@ void vtkmNDHistogram::PrintSelf(std::ostream& os, vtkIndent indent)
}
//------------------------------------------------------------------------------
vtkmNDHistogram::vtkmNDHistogram() {}
vtkmNDHistogram::vtkmNDHistogram() = default;
//------------------------------------------------------------------------------
vtkmNDHistogram::~vtkmNDHistogram() {}
vtkmNDHistogram::~vtkmNDHistogram() = default;
//------------------------------------------------------------------------------
void vtkmNDHistogram::AddFieldAndBin(const std::string& fieldName, const vtkIdType& numberOfBins)
......
......@@ -33,10 +33,10 @@
vtkStandardNewMacro(vtkmPointElevation);
//------------------------------------------------------------------------------
vtkmPointElevation::vtkmPointElevation() {}
vtkmPointElevation::vtkmPointElevation() = default;
//------------------------------------------------------------------------------
vtkmPointElevation::~vtkmPointElevation() {}
vtkmPointElevation::~vtkmPointElevation() = default;
//------------------------------------------------------------------------------
int vtkmPointElevation::RequestData(
......
......@@ -36,10 +36,10 @@
vtkStandardNewMacro(vtkmThreshold);
//------------------------------------------------------------------------------
vtkmThreshold::vtkmThreshold() {}
vtkmThreshold::vtkmThreshold() = default;
//------------------------------------------------------------------------------
vtkmThreshold::~vtkmThreshold() {}
vtkmThreshold::~vtkmThreshold() = default;
//------------------------------------------------------------------------------
int vtkmThreshold::RequestData(
......
......@@ -44,7 +44,7 @@ vtkmWarpScalar::vtkmWarpScalar()
}
//------------------------------------------------------------------------------
vtkmWarpScalar::~vtkmWarpScalar() {}
vtkmWarpScalar::~vtkmWarpScalar() = default;
//------------------------------------------------------------------------------
int vtkmWarpScalar::RequestData(vtkInformation* vtkNotUsed(request),
......
......@@ -44,7 +44,7 @@ vtkmWarpVector::vtkmWarpVector()
}
//------------------------------------------------------------------------------
vtkmWarpVector::~vtkmWarpVector() {}
vtkmWarpVector::~vtkmWarpVector() = default;
//------------------------------------------------------------------------------
int vtkmWarpVector::RequestData(vtkInformation* vtkNotUsed(request),
......
......@@ -56,7 +56,7 @@ public:
protected:
vtkCardinalSpline();
~vtkCardinalSpline() override {}
~vtkCardinalSpline() override = default;
void Fit1D(int size, double* x, double* y, double* w, double coefficients[][4],
int leftConstraint, double leftValue, int rightConstraint, double rightValue);
......
......@@ -101,7 +101,7 @@ public:
protected:
vtkKochanekSpline();
~vtkKochanekSpline() override {}
~vtkKochanekSpline() override = default;
void Fit1D(int size, double* x, double* y, double tension, double bias, double continuity,
double coefficients[][4], int leftConstraint, double leftValue, int rightConstraint,
......
......@@ -450,7 +450,7 @@ protected:
int PassiveObserver;
vtkCommand();
~vtkCommand() override {}
~vtkCommand() override = default;
friend class vtkSubjectHelper;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment