The
usual arithmetic conversions are performed for operands of arithmetic or
enumeration type.

additive-expression:multiplicative-expressionadditive-expression+multiplicative-expressionadditive-expression-multiplicative-expression

For addition, either both operands shall have arithmetic or unscoped enumeration
type, or one operand shall be a pointer to a completely-defined object
type and the other shall have integral or unscoped enumeration type.

For subtraction, one of the following shall hold:

- both operands have arithmetic or unscoped enumeration type; or
- both operands are pointers to cv-qualified or cv-unqualified versions of the same completely-defined object type; or
- the left operand is a pointer to a completely-defined object type and the right operand has integral or unscoped enumeration type.

The result of the binary + operator is the sum of the operands.

The result of the binary - operator is the difference resulting
from the subtraction of the second operand from the first.

When an expression J that has integral type
is added to or subtracted from an expression P of pointer type,
the result has the type of P.

- If P evaluates to a null pointer value and J evaluates to 0, the result is a null pointer value.
- Otherwise, if P points to element x[i] of an array object x with n elements,80 the expressions P + J and J + P (where J has the value j) point to the (possibly-hypothetical) element if and the expression P - J points to the (possibly-hypothetical) element if .
- Otherwise, the behavior is undefined.

When two pointer expressions P and Q are subtracted,
the type of the result is an implementation-defined signed
integral type; this type shall be the same type that is defined as
std::ptrdiff_t in the <cstddef>
header ([support.types]).

- If P and Q both evaluate to null pointer values, the result is 0.
- Otherwise, if P and Q point to, respectively, elements x[i] and x[j] of the same array object x, the expression P - Q has the value .
- Otherwise, the behavior is undefined. [ Note: If the value is not in the range of representable values of type std::ptrdiff_t, the behavior is undefined. —]
*end note*

An object that is not an array element is considered to belong to a
single-element array for this purpose; see [expr.unary.op].

A pointer past the last element of an array x of n elements
is considered to be equivalent to a pointer to a hypothetical element
x[n] for this purpose; see [basic.compound].

⮥