Skip to content

Commit

Permalink
STYLE: Pefer = 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 Mar 18, 2019
1 parent a827c83 commit 7d47862
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter :

protected:
TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter();
~TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter();
~TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter() override = default;

void PrintSelf( std::ostream & os, Indent indent ) const override;
void BeforeThreadedGenerateData() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter
this->SetDisplacementFieldExtrapolator(DefaultDisplacementFieldExtrapolatorType::New());
}

template<typename TTimeVaryingVelocityField, typename TDisplacementField>
TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter
<TTimeVaryingVelocityField, TDisplacementField>
::~TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter()
{
}

template<typename TTimeVaryingVelocityField, typename TDisplacementField>
void
TimeVaryingVelocityFieldSemiLagrangianIntegrationImageFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class TimeVaryingVelocityFieldSemiLagrangianTransform :

protected:
TimeVaryingVelocityFieldSemiLagrangianTransform();
virtual ~TimeVaryingVelocityFieldSemiLagrangianTransform(){};
~TimeVaryingVelocityFieldSemiLagrangianTransform() override = default;

private:
TimeVaryingVelocityFieldSemiLagrangianTransform( const Self& ) ITK_DELETE_FUNCTION;
Expand Down

0 comments on commit 7d47862

Please sign in to comment.