On Sonntag, 19. April 2020 14:39:40 CEST André Pönitz wrote:
> On Sun, Apr 19, 2020 at 02:21:39PM +0200, Allan Sandfeld Jensen wrote:
> > > I don't think we need "incomparable" here.
> > > 
> > > QVariant(TypeA) and QVariant(TypeB) can be ordered for different TypeA
> > > and
> > > TypeB based e.g. on alphabetical order of their .typeName().
> > > 
> > > If wanted, this can be refined to make e.g. all integral types
> > > comparable.
> > 
> > What about non-integral types?
> 
> They are compared by typeName(). So any QChar would be less-than any
> QRegularExpression.
> 
> > QVariants can't really be anything but weakly ordered as I see it,
> > as some of the things it contains are either non- comparable or
> > weakly ordered themselves.
> 
> On the inner level the situation is up to the actual type, that's no
> different than today, and would also not be affected by disallowing
> comparisons between different types.
> 
Yes, but in C++20 terms the comparison operators still need to return types of 
https://en.cppreference.com/w/cpp/utility/compare/partial_ordering[1] 

But all that really isn't possible before C++20 as I see it.

'Allan

--------
[1] https://en.cppreference.com/w/cpp/utility/compare/partial_ordering
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to