offset < length is a safer bounds check than pointer < pointer_to_end. If offset is before the start (underflows), the condition is false.
-
-
If offset goes too low, offset < length isn't true: integer underflow. If ptr goes too low, ptr < end_ptr remains true (unless past null)
-
offset < length is as strong as start <= ptr && ptr <= end -- except, not! Making a ptr outside of the object/end is *undefined behavior*.
End of conversation
New conversation -
-
-
Assuming unsigned offset?
-
Naturally. Sorry, hard to fit in a single tweet. :)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.