Skip to content

Commit 18b8bc7

Browse files
committed
[expr.add] Simplify phrasing around ptrdiff_t and avoid redundancy
1 parent 1175936 commit 18b8bc7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

source/expressions.tex

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7201,18 +7201,13 @@
72017201
\end{note}
72027202

72037203
\pnum
7204-
\indextext{\idxcode{ptrdiff_t}!implementation-defined type of}%
7205-
\indextext{subtraction!implementation-defined pointer}%
72067204
\indextext{\idxcode{ptrdiff_t}}%
72077205
\indextext{comparison!undefined pointer}%
7208-
When two pointer expressions \tcode{P} and \tcode{Q} are subtracted,
7209-
the type of the result is an \impldef{type of \tcode{ptrdiff_t}} signed
7210-
integral type; this type shall be the same type that is named by
7211-
\tcode{std::ptrdiff_t} in the \libheader{cstddef}
7212-
header\iref{support.types.layout}.
7206+
The result of subtracting two pointer expressions \tcode{P} and \tcode{Q}
7207+
is a prvalue of type \tcode{std::ptrdiff_t}\iref{support.types.layout}.
72137208
\begin{itemize}
72147209
\item If \tcode{P} and \tcode{Q} both evaluate to null pointer values,
7215-
the result is 0.
7210+
the value is 0.
72167211
\item Otherwise, if \tcode{P} and \tcode{Q} point to, respectively,
72177212
array elements $i$ and $j$
72187213
of the same array object \tcode{x},

0 commit comments

Comments
 (0)