Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In C++ comparing them is unspecified, and theoretically can even change from invocation to invocation. But it's not UB.

http://eel.is/c++draft/expr.rel#4.3.sentence-1

std::less is blessed by the standard to work with any two pointers, so relational containers work with pointers.



The other annoyance is the unsinged v/s signed mess in going from size_t to ptrdiff_t.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: