diff --git a/Modules/Core/Common/include/itkCompensatedSummation.h b/Modules/Core/Common/include/itkCompensatedSummation.h index 9af83c4af5e..3cefc4ad1a3 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.h +++ b/Modules/Core/Common/include/itkCompensatedSummation.h @@ -76,7 +76,7 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation using Self = CompensatedSummation; /** Constructors. */ - CompensatedSummation(); + CompensatedSummation() = default; CompensatedSummation(FloatType value); /** Copy constructor. */ @@ -120,8 +120,8 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation explicit operator FloatType() const; private: - AccumulateType m_Sum; - AccumulateType m_Compensation; + AccumulateType m_Sum{}; + AccumulateType m_Compensation{}; // Maybe support more types in the future with template specialization. #ifdef ITK_USE_CONCEPT_CHECKING diff --git a/Modules/Core/Common/include/itkCompensatedSummation.hxx b/Modules/Core/Common/include/itkCompensatedSummation.hxx index 4be5d2f1ef1..1ed32deee06 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.hxx +++ b/Modules/Core/Common/include/itkCompensatedSummation.hxx @@ -58,13 +58,6 @@ CompensatedSummationAddElement(TFloat & compensation, TFloat & sum, const TFloat # endif // _MSC_VER #endif // not itkCompensatedSummation_cxx -template -CompensatedSummation::CompensatedSummation() - : m_Sum(NumericTraits::ZeroValue()) - , m_Compensation(NumericTraits::ZeroValue()) -{} - - template CompensatedSummation::CompensatedSummation(const TFloat value) : m_Sum(value)