File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 72067206\indextext {\idxcode {ptrdiff_t}}%
72077207\indextext {comparison!undefined pointer}%
72087208When 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 }.
7209+ the result is a prvalue of type \tcode {std::ptrdiff_t}.
72137210\begin {itemize }
72147211\item If \tcode {P} and \tcode {Q} both evaluate to null pointer values,
7215- the result is 0.
7212+ the value is 0.
72167213\item Otherwise, if \tcode {P} and \tcode {Q} point to, respectively,
72177214array elements $ i$ and $ j$
72187215of the same array object \tcode {x},
72257222\end {note }
72267223\item Otherwise, the behavior is undefined.
72277224\end {itemize }
7225+ \begin {note }
7226+ The \grammarterm {typedef-name} \tcode {std::size_t} is declared in the standard header
7227+ \libheader {cstddef}\iref {cstddef.syn,support.types.layout }.
7228+ \end {note }
72287229
72297230\pnum
72307231For addition or subtraction, if the expressions \tcode {P} or \tcode {Q} have
You can’t perform that action at this time.
0 commit comments