Skip to content

Commit b5410c5

Browse files
committed
DOC: Do not require using NumericTraits, replace ZeroValue() with {}
Dropped the requirement to use NumericTraits for all numeric data member initialization. Following pull request InsightSoftwareConsortium/ITK#3950 by Hans Johnson.
1 parent e87397d commit b5410c5

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,9 +1575,9 @@ \section{Initialization and Assignment}
15751575
double m_Thickness{ 1.0 };
15761576
bool m_Normalize{ false };
15771577
bool m_BrightCenter{ false };
1578-
PixelType m_InteriorValue{ NumericTraits<PixelType>::ZeroValue() };
1578+
PixelType m_InteriorValue{};
15791579
PixelType m_AnnulusValue{ NumericTraits<PixelType>::OneValue() };
1580-
PixelType m_ExteriorValue{ NumericTraits<PixelType>::ZeroValue() };
1580+
PixelType m_ExteriorValue{};
15811581
SpacingType m_Spacing{ 1.0 };
15821582
\end{minted}
15831583
\normalsize
@@ -1598,7 +1598,7 @@ \section{Initialization and Assignment}
15981598
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cpp}
15991599
template <typename TInputImage, typename TOutputImage>
16001600
SpecializedFilter<TInputImage, TOutputImage>::SpecializedFilter()
1601-
: m_BackgroundValue(NumericTraits<OutputImagePixelType>::ZeroValue())
1601+
: m_BackgroundValue{}
16021602
, m_ForegroundValue(NumericTraits<OutputImagePixelType>::OneValue())
16031603
{
16041604
...
@@ -1613,7 +1613,7 @@ \section{Initialization and Assignment}
16131613
template <typename TInputImage, typename TOutputImage>
16141614
SpecializedFilter<TInputImage, TOutputImage>::SpecializedFilter()
16151615
{
1616-
m_BackgroundValue = NumericTraits<OutputImagePixelType>::ZeroValue();
1616+
m_BackgroundValue = {};
16171617
m_ForegroundValue = NumericTraits<OutputImagePixelType>::OneValue();
16181618
16191619
...
@@ -1639,10 +1639,6 @@ \section{Initialization and Assignment}
16391639
example \code{FixedArray::m\_InternalArray} and \code{Index::m\_InternalArray}
16401640
do not have a default member initializer.
16411641
1642-
Note that all numeric data members must be initialized using the appropriate
1643-
ITK's \code{NumericTraits} static method.
1644-
1645-
16461642
\section{Accessing Members}
16471643
\label{sec:Accessing Members}
16481644
@@ -2231,7 +2227,7 @@ \subsection{White Spaces}
22312227
template <typename TInputImage, typename TOutputImage>
22322228
SpecializedFilter<TInputImage, TOutputImage>::SpecializedFilter()
22332229
: m_ForegroundValue(NumericTraits<InputImagePixelType>::max())
2234-
, m_BackgroundValue(NumericTraits<InputImagePixelType>::ZeroValue())
2230+
, m_BackgroundValue{}
22352231
, m_NumPixelComponents(0)
22362232
, m_NoiseSigmaIsSet(false)
22372233
, m_SearchSpaceList(ListAdaptorType::New())

0 commit comments

Comments
 (0)