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

Jędrzej Nowacki jedrzej.nowacki at qt.io
Mon Sep 26 09:55:13 CEST 2016


On fredag 23. september 2016 11.22.08 CEST Olivier Goffart wrote:
>   template<class T>
>   auto registerEqualityOperator() 
>             -> decltype(std::declval<T>() == std::declval<T>()) 

I have tried it already. Sadly it breaks terribly in case of private/protected 
operators. It doesn't solve the problem, because types may got converted just 
to satisfy operator== type requirements. In addition it causes small perf 
problems.

So QVariant::operator== is broken and it is not fixable without _major_ 
breakages.   

Cheers,
 Jędrek



More information about the Development mailing list