On segunda-feira, 26 de setembro de 2016 09:57:27 PDT Jędrzej Nowacki wrote:
> No. I think we should avoid it, there are to many side effects of such
> behavior change.
Ok, I will restore the original patch that keeps the fuzzy comparison, just
skips it for NaN and infinite.
--
Thiago Macieira
On Fri, Sep 23, 2016 at 09:56:30AM +, Edward Welbourne wrote:
>> Indeed; having all values of some type equivalent is worse (for the "has
>> my value changed" test you illustrate, at least) than having a value not
>> equal to itself (which triggers a "changed" event for a non-change). In
>>
On Freitag, 23. September 2016 19:45:18 CEST André Pönitz wrote:
> On Fri, Sep 23, 2016 at 11:22:08AM +0200, Olivier Goffart wrote:
> > > There is not much of a choice. An equivalence relation is reflexive,
> > > i.e. at least Foo(a) == Foo(a) must be true. Lacking the ability
> > > to compare
On Montag, 26. September 2016 09:55:13 CEST Jędrzej Nowacki wrote:
> On fredag 23. september 2016 11.22.08 CEST Olivier Goffart wrote:
> > template
> > auto registerEqualityOperator()
> >
> > -> decltype(std::declval() == std::declval())
>
> I have tried it already. Sadly it
On mandag 19. september 2016 09.20.48 CEST Thiago Macieira wrote:
> This code was there in Qt 5.0, so I kept it when I refactored the numeric
> comparisons. Now, dealing with QTBUG-56073, I'm wondering if it should be
> there in the first place.
>
> Should we do fuzzy comparisns in QVariant?
>
>
On fredag 23. september 2016 11.22.08 CEST Olivier Goffart wrote:
> template
> auto registerEqualityOperator()
> -> decltype(std::declval() == std::declval())
I have tried it already. Sadly it breaks terribly in case of private/protected
operators. It doesn't solve the problem,
On 2016-09-23, André Pönitz wrote:
> That gives already "surprising" behaviour if fed with QChar('a') and
> QString("a") in a row.
>
> And it is "surprising" to a degree that I'd call it buggy.
Then try feeding it boolean's and strings.
QQmlPropertyMap map;
On Fri, Sep 23, 2016 at 09:56:30AM +, Edward Welbourne wrote:
> Indeed; having all values of some type equivalent is worse (for the "has
> my value changed" test you illustrate, at least) than having a value not
> equal to itself (which triggers a "changed" event for a non-change). In
> fact
On Fri, Sep 23, 2016 at 11:22:08AM +0200, Olivier Goffart wrote:
> > There is not much of a choice. An equivalence relation is reflexive,
> > i.e. at least Foo(a) == Foo(a) must be true. Lacking the ability
> > to compare Foos, treating them all equal at least doesn't break the
> > relation.
>
>
On 2016-09-22 16:58, André Pönitz wrote:
> There is not much of a choice. An equivalence relation is reflexive,
> i.e. at least Foo(a) == Foo(a) must be true.
JFTR...
auto nan = qNaN();
assert(nan != nan); // okay
assert(!(nan == nan)); // okay
--
Matthew
Olivier Goffart
> What use case did you have in mind where a reflexive relation is any usefull?
Well, having x == x for all x is generally considered a useful property
of equality. That's all "reflexive" is saying.
> There is the case of the key of a QHash or in a QSet, but even then i'm not
>
On Donnerstag, 22. September 2016 22:58:09 CEST André Pönitz wrote:
> On Thu, Sep 22, 2016 at 06:04:58AM +0200, Mathias Hasselmann wrote:
> > Am 22.09.2016 um 00:58 schrieb André Pönitz:
> > >On Wed, Sep 21, 2016 at 08:57:01AM +0200, Olivier Goffart wrote:
> > >>>No, it's not. It's changing
On Thu, Sep 22, 2016 at 06:04:58AM +0200, Mathias Hasselmann wrote:
> Am 22.09.2016 um 00:58 schrieb André Pönitz:
> >On Wed, Sep 21, 2016 at 08:57:01AM +0200, Olivier Goffart wrote:
> >>>No, it's not. It's changing undefined behavior into defined
> >>>behavior.
> >>
> >>But in many case, we want
On quarta-feira, 21 de setembro de 2016 12:00:15 PDT Marc Mutz wrote:
> We have a handful of classes in Qt which have a
> 'reserved' field that doesn't get initialized (so it better should be named
> 'unusable')
That depends on whether the copy constructors and destructor are inline or
not.
--
Am 22.09.2016 um 00:58 schrieb André Pönitz:
On Wed, Sep 21, 2016 at 08:57:01AM +0200, Olivier Goffart wrote:
No, it's not. It's changing undefined behavior into defined
behavior.
But in many case, we want to put something in a QVariant, and we
never compare this variant. Forbidding types
Am 21.09.2016 um 12:00 schrieb Marc Mutz:
On Wednesday 21 September 2016 11:42:41 Mathias Hasselmann wrote:
No matter what order I use for config and value, the compiler will pad
and -Wpadded will complain. How am I supposed to fix this? This
solutions that come to my mind all are ugly, but
On Wed, Sep 21, 2016 at 08:57:01AM +0200, Olivier Goffart wrote:
> > No, it's not. It's changing undefined behavior into defined
> > behavior.
>
> But in many case, we want to put something in a QVariant, and we
> never compare this variant. Forbidding types that do not have an
> operator== to
On Wednesday 21 September 2016 11:42:41 Mathias Hasselmann wrote:
> Am 21.09.2016 um 09:52 schrieb Marc Mutz:
> > On Wednesday 21 September 2016 09:23:35 Mathias Hasselmann wrote:
> >> Maybe some clever use of type traits can tell us if your structs contain
> >> alignment wholes?
> >
> >
Am 21.09.2016 um 09:52 schrieb Marc Mutz:
On Wednesday 21 September 2016 09:23:35 Mathias Hasselmann wrote:
Maybe some clever use of type traits can tell us if your structs contain
alignment wholes?
-Werror=padded :)
Yes, but how is it supposed to help? Let me show a real world example:
On Wednesday 21 September 2016 09:23:35 Mathias Hasselmann wrote:
> Maybe some clever use of type traits can tell us if your structs contain
> alignment wholes?
-Werror=padded :)
--
Marc Mutz | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Am 21.09.2016 um 08:57 schrieb Olivier Goffart:
On Mittwoch, 21. September 2016 08:01:22 CEST Mathias Hasselmann wrote:
As much as I'd like to debug this code now to prove me right, I sadly
have deadlines to meet this week. So I have to behave myself to not dig
up the code right now. Maybe
On Mittwoch, 21. September 2016 08:01:22 CEST Mathias Hasselmann wrote:
> Am 20.09.2016 um 12:44 schrieb Olivier Goffart:
> > On Dienstag, 20. September 2016 12:21:11 CEST Mathias Hasselmann wrote:
> >> Am 19.09.2016 um 23:27 schrieb Olivier Goffart:
> >>> We really cannot have a qHash for
Am 20.09.2016 um 12:44 schrieb Olivier Goffart:
On Dienstag, 20. September 2016 12:21:11 CEST Mathias Hasselmann wrote:
Am 19.09.2016 um 23:27 schrieb Olivier Goffart:
We really cannot have a qHash for QVariant anyway, because that would
imply
that ALL QVariant can be hashed, and compared.
On quarta-feira, 21 de setembro de 2016 03:56:31 PDT Kevin Kofler wrote:
> Thiago Macieira wrote:
> > And I will reject any patch that adds more complexity in qFuzzyCompare for
> > a 0.01% corner-case. Instead, we should document that it only works for
> > finite numbers far enough away from zero.
Thiago Macieira wrote:
> And I will reject any patch that adds more complexity in qFuzzyCompare for
> a 0.01% corner-case. Instead, we should document that it only works for
> finite numbers far enough away from zero. If your number can be infinite
> or NaN or zero, you have to find something
On terça-feira, 20 de setembro de 2016 11:29:32 PDT Olivier Goffart wrote:
> > Is such a behavior change really acceptable for 5.8? I think it can break
> > applications that were relying on the current behavior in pretty bad, hard
> > to debug ways (random bugs based on rounding errors).
>
> I
On Tuesday 20 September 2016 12:44:04 Olivier Goffart wrote:
> > It is easy to forget registering comparator functions and currently Qt
> > doesn't help in debugging such issues. So I wonder if QVariant should
> > forbid comparison of custom types without having a comparator function
> >
On Dienstag, 20. September 2016 12:21:11 CEST Mathias Hasselmann wrote:
> Am 19.09.2016 um 23:27 schrieb Olivier Goffart:
> > 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
Am 19.09.2016 um 23:27 schrieb Olivier Goffart:
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.
Which actually is quite a serious
On Dienstag, 20. September 2016 03:08:42 CEST Kevin Kofler wrote:
> Thiago Macieira wrote:
> > Since this is a P3 and 5.8 hasn't been released, I will push the behaviour
> > change to 5.8 and drop the fuzzy comparison.
>
> Is such a behavior change really acceptable for 5.8? I think it can break
On Monday 19 September 2016 23:27:52 Olivier Goffart wrote:
> 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
Thiago Macieira wrote:
> Since this is a P3 and 5.8 hasn't been released, I will push the behaviour
> change to 5.8 and drop the fuzzy comparison.
Is such a behavior change really acceptable for 5.8? I think it can break
applications that were relying on the current behavior in pretty bad, hard
On Monday 19 September 2016, Thiago Macieira wrote:
> On segunda-feira, 19 de setembro de 2016 21:21:01 PDT André Pönitz wrote:
> > On Mon, Sep 19, 2016 at 11:10:51AM -0700, Thiago Macieira wrote:
> > > Since this is a P3 and 5.8 hasn't been released, I will push the
> > > behaviour change to 5.8
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
On segunda-feira, 19 de setembro de 2016 21:21:01 PDT André Pönitz wrote:
> On Mon, Sep 19, 2016 at 11:10:51AM -0700, Thiago Macieira wrote:
> > Since this is a P3 and 5.8 hasn't been released, I will push the behaviour
> > change to 5.8 and drop the fuzzy comparison.
On Mon, Sep 19, 2016 at 11:10:51AM -0700, Thiago Macieira wrote:
> On segunda-feira, 19 de setembro de 2016 19:47:12 PDT André Pönitz wrote:
> > On Mon, Sep 19, 2016 at 09:20:48AM -0700, Thiago Macieira wrote:
> > > This code was there in Qt 5.0, so I kept it when I refactored the numeric
> > >
On segunda-feira, 19 de setembro de 2016 19:47:12 PDT André Pönitz wrote:
> On Mon, Sep 19, 2016 at 09:20:48AM -0700, Thiago Macieira wrote:
> > This code was there in Qt 5.0, so I kept it when I refactored the numeric
> > comparisons. Now, dealing with QTBUG-56073, I'm wondering if it should be
>
On Mon, Sep 19, 2016 at 06:48:10PM +0200, Marc Mutz wrote:
> Fuzzy comparision should be performed with a named function, qFuzzyCompare,
> and _only_ with that function.
+1.
> We need to fix other classes for Qt 6, too (e.g. Q(Size|Point|Line)F.
+1.
> That said, a qFuzzyCompare(QVariant,
On Mon, Sep 19, 2016 at 09:20:48AM -0700, Thiago Macieira wrote:
> This code was there in Qt 5.0, so I kept it when I refactored the numeric
> comparisons. Now, dealing with QTBUG-56073, I'm wondering if it should be
> there in the first place.
>
> Should we do fuzzy comparisns in QVariant?
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.
Fuzzy comparision should be performed with a named function,
This code was there in Qt 5.0, so I kept it when I refactored the numeric
comparisons. Now, dealing with QTBUG-56073, I'm wondering if it should be
there in the first place.
Should we do fuzzy comparisns in QVariant?
Note that the fuzzy comparisons are always performed in qreal precision
41 matches
Mail list logo