Skip to content

Commit e8ae54e

Browse files
authored
Merge pull request #183 from N-Dekker/IntegerTypeSpecifiers
DOC: Add "Integer Type Specifiers" section
2 parents 8948fec + 612adf5 commit e8ae54e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,21 @@ \subsection{Const Correctness}
13761376
\end{itemize}
13771377
13781378
1379+
\subsection{Integer Type Specifiers}
1380+
\label{subsec:IntegerTypeSpecifiers}
1381+
1382+
Throughout the code base, the built-in type \code{unsigned int} is spelled exactly like that:
1383+
``unsigned int'' (rather than just ``unsigned''). Other built-in integer types should in
1384+
general be specified by their shortest form. For example, ``short'', ``long'', and ``long long''
1385+
are preferred to ``signed short int'', ``signed long int'', and ``signed long long int''.
1386+
1387+
Within the \code{itk} namespace, integer type aliases from C++ Standard headers for C library
1388+
facilities (like \code{<cstdlib>} and \code{<cstdint>}) should generally be used without a \code{std::} prefix.
1389+
For example, ``size\_t'', ``int8\_t'', and ``uintmax\_t'' are preferred to ``std::size\_t'',
1390+
``std::int8\_t'', and ``std::uintmax\_t''. When using any of those type aliases, the ITK header file
1391+
``itkIntTypes.h'' may need to be \code{\#include}d, to ensure that those types are declared within the
1392+
\code{itk} namespace.
1393+
13791394
\section{Namespaces}
13801395
\label{sec:Namespaces}
13811396

0 commit comments

Comments
 (0)