Language Lawyer

2018-08-29 01:21:05 UTC

Is it any rule speaking about values of objects and relations between them?

For example, let's take a look at [expr.add]/4:

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

If the expression P points to element x[i] of an array object x with n elements, the expressions P + J and J + P (where J has the value j) point to the (possibly-hypothetical) element x[i+j] if 0≤i+j≤n; otherwise, the behavior is undefined.

Is this requirement on the value of a pointer and the value of an integer expression a semantic rule?

For example, let's take a look at [expr.add]/4:

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

If the expression P points to element x[i] of an array object x with n elements, the expressions P + J and J + P (where J has the value j) point to the (possibly-hypothetical) element x[i+j] if 0≤i+j≤n; otherwise, the behavior is undefined.

Is this requirement on the value of a pointer and the value of an integer expression a semantic rule?

--

---

You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.

To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+***@isocpp.org.

To post to this group, send email to std-***@isocpp.org.

Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.

---

You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.

To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+***@isocpp.org.

To post to this group, send email to std-***@isocpp.org.

Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.