Skip to content

Commit d07be39

Browse files
author
Jon Haitz Legarreta
committed
DOC: Add a note about direct vs. macro call ivar initialization.
Add a note about direct vs. macro call ivar initialization motivated by the discussion in: http://review.source.kitware.com/#/c/23434
1 parent ea5b926 commit d07be39

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,19 @@ \section{Initialization and Assignment}
15061506
\end{minted}
15071507
\normalsize
15081508
1509+
Nevertheless, there may be some exceptions to the initialization list rule. In
1510+
some situations where it can be foreseen that the corresponding
1511+
\code{Set\#\#name} or \code{\#\#nameOn}/\code{\#\#nameOff} may be
1512+
1513+
\begin{itemize}
1514+
\item overloaded by some classes in the future, or
1515+
\item deprecated, and a warning thrown when it is called to help migration,
1516+
\end{itemize}
1517+
1518+
initialization through the corresponding \code{Set\#\#name} or
1519+
\code{\#\#nameOn}/\code{\#\#nameOff} method is recommended instead of directly
1520+
manipulating the data member.
1521+
15091522
Smart pointers need not to be initialized, since they initialize themselves
15101523
to the \code{null} pointer, so they are the sole exception to the above rule.
15111524

0 commit comments

Comments
 (0)