News for hackers. Stuff that matters.
Re:In C++, is empty() faster than comparing the size with zero? by DSMan195276 on Thursday October 28, 2021 @02:58PM (#29030083)
Yes that's right - unsigned is defined to wrap, but ints have undefined behavior if you add to the max value (or do other silly things with them). Thus the int version given could be optimized to do whatever when a positive integer is passed, since it only doesn't have UB when negatives or zero are passed.

There are no comments on this comment yet.