|
bool operator<(const QColor & a, const QColor & b) { |
|
return a.redF() < b.redF() |
|
|| a.greenF() < b.greenF() |
|
|| a.blueF() < b.blueF() |
|
|| a.alphaF() < b.alphaF(); |
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.