3 ms·
I don't see how that's specific to comparison functions. It's just a result of someone not unit-testing their code. I was expecting to see an example of struct
by HarHarVeryFunny 5y ago
I don't see how that's specific to comparison functions. It's just a result of someone not unit-testing their code.
I was expecting to see an example of structure comparisons such as struct date {int year; int month; int day;} which are easy to get wrong unless you've internalized the pattern (or use modern C++ where it'll generate the comparison operators automatically for you).
- AndreyKarpov 5y agoThe main specific is that it’s one of the most common errors. People don’t check comparison functions, but those functions have errors. You can read more here: https://pvs-studio.com/en/blog/posts/cpp/0509/ https://pvs-studio.com/en/blog/posts/cpp/0509/