2014-09-21 1:48 GMT+08:00 Nat Goodspeed <nat@lindenlab.com>:
On Sat, Sep 20, 2014 at 3:20 AM, TONGARI J <tongari95@gmail.com> wrote:

> I guess something like below should work?
>
>     #include <iostream>
>
>     __attribute__((noinline)) bool is_upward_test(char* a)
>     {
>         char b[32];
>         return a < b;
>     }
>
>     bool is_upward()
>     {
>         char a[32];
>         return is_upward_test(a);
>     }
>
>     int main(int argc, char** argv) {
>         std::cout << is_upward();
>     return 0;
>     }

Doesn't the standard say pointer comparisons are only defined between
pointers into the same container? Therefore wouldn't the above be UB?

o_O!? That would be scary, do you really mean pointer or iterator? Where's the paragraph?