stackoverflown
stackoverflown copied to clipboard
Incorrect comparison function - violates strict weak ordering
https://github.com/KubaO/stackoverflown/blob/b3d59cfa491140759991f8a50392c785c9c50127/questions/qmap-qcolor-32512125/main.cpp#L4-L8
This comparison function violates the requirement for Strict Weak Ordering and will cause undefined behaviour/corruption inside the map.
Consider colours A(255, 0, 0) and B(0, 255, 0). Both A < B and B < A will return true.