Note that the behavior of comparing pointers that don't point to the same array is undefined.
–
avakarAug 29 '09 at 5:47

3

Note that in C++ the operator() of std::less<T*>, std::less_equal<T*>, std::greater<T*> and std::greater_equal<T*> are able to compare pointers to different object meaningfully.
–
AProgrammerAug 29 '09 at 6:46

8

@avakar: Technically, the behaviour is not undefined (the result must of the comparison must be a bool, the implementation shouldn't randomly crash or anything); the result of the comparison is unspecified - i.e. it could be true or false and the implementation doesn't have to document what the result is.
–
Charles BaileyAug 29 '09 at 7:25