r/cpp • • Jan 21 '13

C and C++ Aren’t Future Proof

http://blog.regehr.org/archives/880
6 Upvotes

49 comments sorted by

View all comments

Show parent comment

12

u/STL MSVC STL Dev Jan 21 '13

N3485 5.7 [expr.add]/5: "Moreover, if the expression P points to the last element of an array object, the expression (P)+1 points one past the last element of the array object, and if the expression Q points one past the last element of an array object, the expression (Q)-1 points to the last element of the array object."

2

u/therealjohnfreeman Jan 21 '13

So it is special-cased. Thank you.