Skip to content

Commit

Permalink
Merge pull request #1370 from WalterBright/ptrdiff_t
Browse files Browse the repository at this point in the history
pointer subtraction yields ptrdiff_t
  • Loading branch information
andralex committed Jun 16, 2016
2 parents 0d7bf14 + 15f3c2c commit 281daed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/expression.dd
Expand Up @@ -557,9 +557,14 @@ $(GNAME AddExpression):
)

$(P If both operands are pointers, and the operator is $(D +),
then it is illegal. For $(D -), the pointers are subtracted and the
then it is illegal.
)

$(P If both operands are pointers, and the operator is $(D -),
the pointers are subtracted and the
result is divided by the size of the type pointed to by the
operands. It is an error if the pointers point to different types.
The type of the result is $(D ptrdiff_t).
)

$(P If both operands are of integral types and an overflow or underflow
Expand Down

0 comments on commit 281daed

Please sign in to comment.