[Development] Should QVariant be doing fuzzy comparisons on doubles?

Olivier Goffart olivier at woboq.com
Mon Sep 19 23:27:52 CEST 2016


On Montag, 19. September 2016 18:48:10 CEST Marc Mutz wrote:
> On Monday 19 September 2016 18:20:48 Thiago Macieira wrote:
> > Should we do fuzzy comparisns in QVariant?
> 
> If you talk about op==, then using fuzzy compare is a definite no-no,
> because it makes it impossible to define a hash function.

We really cannot have a qHash for QVariant anyway, because that would imply 
that ALL QVariant can be hashed, and compared. Which is not the case. Most 
custom types don't even register comparator function. 
So I don't think that's an argument.

-- 
Olivier

Woboq - Qt services and support - https://woboq.com - https://code.woboq.org



More information about the Development mailing list