3 ms·
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.sen
by leni536 6y ago
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 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.
- bubblethink 6y agoThe other annoyance is the unsinged v/s signed mess in going from size_t to ptrdiff_t.