Skip to content

Commit 6525a5c

Browse files
N-Dekkerdzenanz
authored andcommitted
DOC: Remove mistaken exception to data member initialization guideline
When a data member is set by a "setter" member function (`Set##name`, `On`, or `Off`), it is still recommended to initialize the member according to this guideline. Doing so prevents problems like the one addressed by pull request InsightSoftwareConsortium/ITK#3845 commit InsightSoftwareConsortium/ITK@a31e8bf "BUG: Fix uninitialized value ImageRegistrationMethodv4::m_NumberOfLevels" by Jon Haitz Legarreta Gorroño, 10 January 2023
1 parent 013c3b5 commit 6525a5c

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,19 +1621,6 @@ \section{Initialization and Assignment}
16211621
\end{minted}
16221622
\normalsize
16231623
1624-
Nevertheless, there may be some exceptions to the initialization list rule. In
1625-
some situations where it can be foreseen that the corresponding
1626-
\code{Set\#\#name} or \code{\#\#nameOn}/\code{\#\#nameOff} may be
1627-
1628-
\begin{itemize}
1629-
\item overloaded by some classes in the future, or
1630-
\item deprecated, and a warning thrown when it is called to help migration,
1631-
\end{itemize}
1632-
1633-
initialization through the corresponding \code{Set\#\#name} or
1634-
\code{\#\#nameOn}/\code{\#\#nameOff} method is recommended instead of directly
1635-
manipulating the data member.
1636-
16371624
Smart pointers need not to be initialized, since they initialize themselves
16381625
to the \code{null} pointer, so they are the sole exception to the above rule.
16391626

0 commit comments

Comments
 (0)