Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7206,13 +7206,10 @@
\indextext{\idxcode{ptrdiff_t}}%
\indextext{comparison!undefined pointer}%
When two pointer expressions \tcode{P} and \tcode{Q} are subtracted,
the type of the result is an \impldef{type of \tcode{ptrdiff_t}} signed
integral type; this type shall be the same type that is named by
\tcode{std::ptrdiff_t} in the \libheader{cstddef}
header\iref{support.types.layout}.
the result is a prvalue of type \tcode{std::ptrdiff_t}.
\begin{itemize}
\item If \tcode{P} and \tcode{Q} both evaluate to null pointer values,
the result is 0.
the value is 0.
\item Otherwise, if \tcode{P} and \tcode{Q} point to, respectively,
array elements $i$ and $j$
of the same array object \tcode{x},
Expand All @@ -7225,6 +7222,10 @@
\end{note}
\item Otherwise, the behavior is undefined.
\end{itemize}
\begin{note}
The \grammarterm{typedef-name} \tcode{std::ptrdiff_t} is declared in the standard header
\libheader{cstddef}\iref{cstddef.syn,support.types.layout}.
\end{note}

\pnum
For addition or subtraction, if the expressions \tcode{P} or \tcode{Q} have
Expand Down